OLD | NEW |
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" |
| 11 #include "base/message_loop/message_loop.h" |
11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/run_loop.h" |
12 #include "build/build_config.h" | 14 #include "build/build_config.h" |
13 #include "components/version_info/version_info.h" | 15 #include "components/version_info/version_info.h" |
14 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
15 #include "extensions/browser/extension_system.h" | 17 #include "extensions/browser/extension_system.h" |
16 #include "extensions/shell/browser/desktop_controller.h" | 18 #include "extensions/shell/browser/desktop_controller.h" |
17 #include "extensions/shell/browser/shell_content_browser_client.h" | 19 #include "extensions/shell/browser/shell_content_browser_client.h" |
18 #include "extensions/shell/browser/shell_extension_system.h" | 20 #include "extensions/shell/browser/shell_extension_system.h" |
19 | 21 |
20 namespace extensions { | 22 namespace extensions { |
21 | 23 |
(...skipping 28 matching lines...) Expand all Loading... |
50 } | 52 } |
51 | 53 |
52 void AppShellTest::SetUpOnMainThread() { | 54 void AppShellTest::SetUpOnMainThread() { |
53 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); | 55 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); |
54 | 56 |
55 extension_system_ = static_cast<ShellExtensionSystem*>( | 57 extension_system_ = static_cast<ShellExtensionSystem*>( |
56 ExtensionSystem::Get(browser_context_)); | 58 ExtensionSystem::Get(browser_context_)); |
57 } | 59 } |
58 | 60 |
59 void AppShellTest::RunTestOnMainThreadLoop() { | 61 void AppShellTest::RunTestOnMainThreadLoop() { |
60 base::MessageLoopForUI::current()->RunUntilIdle(); | 62 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 63 base::RunLoop().RunUntilIdle(); |
61 | 64 |
62 SetUpOnMainThread(); | 65 SetUpOnMainThread(); |
63 | 66 |
64 RunTestOnMainThread(); | 67 RunTestOnMainThread(); |
65 | 68 |
66 TearDownOnMainThread(); | 69 TearDownOnMainThread(); |
67 | 70 |
68 // Clean up the app window. | 71 // Clean up the app window. |
69 DesktopController::instance()->CloseAppWindows(); | 72 DesktopController::instance()->CloseAppWindows(); |
70 } | 73 } |
71 | 74 |
72 } // namespace extensions | 75 } // namespace extensions |
OLD | NEW |