Commit e8499d44 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Remove BrowserWithTestWindowTest's AtExitManager.

It was added in 2012 for PrintPreviewTest but is no longer needed and is
causing issues with single process mash tests, where OzonePlatform only
expects to get initialized once. If this happens in a test's SetUp(),
and parts of it get destroyed by the AtExitManager, they won't be re-
initialized for later tests. Tests will still pass in isolation but not
when run as a suite.

This CL also simplifies PrintPreviewTest a bit, which is the test fixture
for which the AtExitManager was originally added.

Bug: 905430
Change-Id: I4617aed098962f4eea6a9d1bfe052e3902278557
Reviewed-on: https://chromium-review.googlesource.com/c/1340798Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608948}
parent 5367e5e7
......@@ -5,19 +5,10 @@
#include "chrome/browser/printing/print_preview_test.h"
#include "chrome/test/base/dialog_test_browser_window.h"
#include "content/public/browser/plugin_service.h"
PrintPreviewTest::PrintPreviewTest() {}
PrintPreviewTest::~PrintPreviewTest() {}
void PrintPreviewTest::SetUp() {
BrowserWithTestWindowTest::SetUp();
// The PluginService will be destroyed at the end of the test (due to the
// ShadowingAtExitManager in our base class).
content::PluginService::GetInstance()->Init();
}
BrowserWindow* PrintPreviewTest::CreateBrowserWindow() {
return new DialogTestBrowserWindow;
}
......@@ -14,8 +14,6 @@ class PrintPreviewTest : public BrowserWithTestWindowTest {
~PrintPreviewTest() override;
protected:
void SetUp() override;
// Create a browser window to provide parenting for web contents modal dialog.
BrowserWindow* CreateBrowserWindow() override;
......
......@@ -9,7 +9,6 @@
#include "base/run_loop.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/print_preview_test.h"
#include "chrome/browser/printing/print_test_utils.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/printing/print_view_manager_base.h"
......@@ -17,12 +16,13 @@
#include "chrome/browser/printing/test_printer_query.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "components/printing/common/print_messages.h"
#include "content/public/test/test_renderer_host.h"
namespace printing {
using PrintViewManagerTest = PrintPreviewTest;
using PrintViewManagerTest = BrowserWithTestWindowTest;
class TestPrintViewManager : public PrintViewManagerBase {
public:
......
......@@ -5,7 +5,6 @@
#ifndef CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_
#define CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_
#include "base/at_exit.h"
#include "base/macros.h"
#include "build/build_config.h"
#include "chrome/browser/ui/browser.h"
......@@ -186,7 +185,6 @@ class BrowserWithTestWindowTest : public testing::Test {
private:
// We need to create a MessageLoop, otherwise a bunch of things fails.
content::TestBrowserThreadBundle thread_bundle_;
base::ShadowingAtExitManager at_exit_manager_;
#if defined(OS_CHROMEOS)
chromeos::ScopedCrosSettingsTestHelper cros_settings_test_helper_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment