Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: extensions/shell/test/shell_test.cc

Issue 2832153003: Move calling of shared browser test methods like SetUpOnMainThread/TearDownOnMainThread/RunTestOn... (Closed)
Patch Set: sync Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/shell/test/shell_test.h ('k') | headless/test/headless_browser_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/shell/test/shell_test.h" 5 #include "extensions/shell/test/shell_test.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 29 matching lines...) Expand all
40 AppShellTest::~AppShellTest() { 40 AppShellTest::~AppShellTest() {
41 } 41 }
42 42
43 void AppShellTest::SetUp() { 43 void AppShellTest::SetUp() {
44 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 44 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
45 command_line->AppendSwitchASCII(switches::kTestType, "appshell"); 45 command_line->AppendSwitchASCII(switches::kTestType, "appshell");
46 SetUpCommandLine(command_line); 46 SetUpCommandLine(command_line);
47 content::BrowserTestBase::SetUp(); 47 content::BrowserTestBase::SetUp();
48 } 48 }
49 49
50 void AppShellTest::SetUpOnMainThread() { 50 void AppShellTest::PreRunTestOnMainThread() {
51 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); 51 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext();
52 52
53 extension_system_ = static_cast<ShellExtensionSystem*>( 53 extension_system_ = static_cast<ShellExtensionSystem*>(
54 ExtensionSystem::Get(browser_context_)); 54 ExtensionSystem::Get(browser_context_));
55 extension_system_->Init(); 55 extension_system_->Init();
56 }
57
58 void AppShellTest::RunTestOnMainThreadLoop() {
59 DCHECK(base::MessageLoopForUI::IsCurrent()); 56 DCHECK(base::MessageLoopForUI::IsCurrent());
60 base::RunLoop().RunUntilIdle(); 57 base::RunLoop().RunUntilIdle();
61 58
62 SetUpOnMainThread(); 59 // TODO(jam): remove this.
60 disable_io_checks();
61 }
63 62
64 RunTestOnMainThread(); 63 void AppShellTest::PostRunTestOnMainThread() {
65
66 TearDownOnMainThread();
67
68 // Clean up the app window. 64 // Clean up the app window.
69 DesktopController::instance()->CloseAppWindows(); 65 DesktopController::instance()->CloseAppWindows();
70 } 66 }
71 67
72 } // namespace extensions 68 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/test/shell_test.h ('k') | headless/test/headless_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698