Chromium Code Reviews| 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/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/run_loop.h" | |
| 12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 13 #include "components/version_info/version_info.h" | 14 #include "components/version_info/version_info.h" |
| 14 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
| 15 #include "extensions/browser/extension_system.h" | 16 #include "extensions/browser/extension_system.h" |
| 16 #include "extensions/shell/browser/desktop_controller.h" | 17 #include "extensions/shell/browser/desktop_controller.h" |
| 17 #include "extensions/shell/browser/shell_content_browser_client.h" | 18 #include "extensions/shell/browser/shell_content_browser_client.h" |
| 18 #include "extensions/shell/browser/shell_extension_system.h" | 19 #include "extensions/shell/browser/shell_extension_system.h" |
| 19 | 20 |
| 20 namespace extensions { | 21 namespace extensions { |
| 21 | 22 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 50 } | 51 } |
| 51 | 52 |
| 52 void AppShellTest::SetUpOnMainThread() { | 53 void AppShellTest::SetUpOnMainThread() { |
| 53 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); | 54 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); |
| 54 | 55 |
| 55 extension_system_ = static_cast<ShellExtensionSystem*>( | 56 extension_system_ = static_cast<ShellExtensionSystem*>( |
| 56 ExtensionSystem::Get(browser_context_)); | 57 ExtensionSystem::Get(browser_context_)); |
| 57 } | 58 } |
| 58 | 59 |
| 59 void AppShellTest::RunTestOnMainThreadLoop() { | 60 void AppShellTest::RunTestOnMainThreadLoop() { |
| 60 base::MessageLoopForUI::current()->RunUntilIdle(); | 61 base::RunLoop().RunUntilIdle(); |
|
gab
2016/08/05 01:09:57
Why didn't the script add a DCHECK IsMessageLoopFo
fdoray
2016/08/05 16:10:36
Done. I added these DCHECKs manually.
| |
| 61 | 62 |
| 62 SetUpOnMainThread(); | 63 SetUpOnMainThread(); |
| 63 | 64 |
| 64 RunTestOnMainThread(); | 65 RunTestOnMainThread(); |
| 65 | 66 |
| 66 TearDownOnMainThread(); | 67 TearDownOnMainThread(); |
| 67 | 68 |
| 68 // Clean up the app window. | 69 // Clean up the app window. |
| 69 DesktopController::instance()->CloseAppWindows(); | 70 DesktopController::instance()->CloseAppWindows(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 } // namespace extensions | 73 } // namespace extensions |
| OLD | NEW |