| 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" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 command_line->AppendSwitchASCII(switches::kTestType, "appshell"); | 49 command_line->AppendSwitchASCII(switches::kTestType, "appshell"); |
| 50 SetUpCommandLine(command_line); | 50 SetUpCommandLine(command_line); |
| 51 content::BrowserTestBase::SetUp(); | 51 content::BrowserTestBase::SetUp(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void AppShellTest::SetUpOnMainThread() { | 54 void AppShellTest::SetUpOnMainThread() { |
| 55 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); | 55 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); |
| 56 | 56 |
| 57 extension_system_ = static_cast<ShellExtensionSystem*>( | 57 extension_system_ = static_cast<ShellExtensionSystem*>( |
| 58 ExtensionSystem::Get(browser_context_)); | 58 ExtensionSystem::Get(browser_context_)); |
| 59 extension_system_->Init(); |
| 59 } | 60 } |
| 60 | 61 |
| 61 void AppShellTest::RunTestOnMainThreadLoop() { | 62 void AppShellTest::RunTestOnMainThreadLoop() { |
| 62 DCHECK(base::MessageLoopForUI::IsCurrent()); | 63 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 63 base::RunLoop().RunUntilIdle(); | 64 base::RunLoop().RunUntilIdle(); |
| 64 | 65 |
| 65 SetUpOnMainThread(); | 66 SetUpOnMainThread(); |
| 66 | 67 |
| 67 RunTestOnMainThread(); | 68 RunTestOnMainThread(); |
| 68 | 69 |
| 69 TearDownOnMainThread(); | 70 TearDownOnMainThread(); |
| 70 | 71 |
| 71 // Clean up the app window. | 72 // Clean up the app window. |
| 72 DesktopController::instance()->CloseAppWindows(); | 73 DesktopController::instance()->CloseAppWindows(); |
| 73 } | 74 } |
| 74 | 75 |
| 75 } // namespace extensions | 76 } // namespace extensions |
| OLD | NEW |