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 "apps/launcher.h" |
5 #include "base/command_line.h" | 6 #include "base/command_line.h" |
6 #include "base/path_service.h" | 7 #include "base/path_service.h" |
7 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
8 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
9 #include "components/guest_view/browser/guest_view_manager.h" | 10 #include "components/guest_view/browser/guest_view_manager.h" |
10 #include "components/guest_view/browser/guest_view_manager_factory.h" | 11 #include "components/guest_view/browser/guest_view_manager_factory.h" |
11 #include "components/guest_view/browser/test_guest_view_manager.h" | 12 #include "components/guest_view/browser/test_guest_view_manager.h" |
12 #include "content/public/common/content_features.h" | 13 #include "content/public/common/content_features.h" |
13 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
14 #include "content/public/test/browser_test.h" | 15 #include "content/public/test/browser_test.h" |
15 #include "content/public/test/browser_test_utils.h" | 16 #include "content/public/test/browser_test_utils.h" |
16 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
17 #include "extensions/browser/app_window/app_window.h" | 18 #include "extensions/browser/app_window/app_window.h" |
18 #include "extensions/browser/app_window/app_window_registry.h" | 19 #include "extensions/browser/app_window/app_window_registry.h" |
| 20 #include "extensions/common/constants.h" |
19 #include "extensions/common/extension.h" | 21 #include "extensions/common/extension.h" |
20 #include "extensions/common/extension_paths.h" | 22 #include "extensions/common/extension_paths.h" |
21 #include "extensions/shell/browser/shell_app_delegate.h" | 23 #include "extensions/shell/browser/shell_app_delegate.h" |
22 #include "extensions/shell/browser/shell_app_view_guest_delegate.h" | 24 #include "extensions/shell/browser/shell_app_view_guest_delegate.h" |
23 #include "extensions/shell/browser/shell_content_browser_client.h" | 25 #include "extensions/shell/browser/shell_content_browser_client.h" |
24 #include "extensions/shell/browser/shell_extension_system.h" | 26 #include "extensions/shell/browser/shell_extension_system.h" |
25 #include "extensions/shell/browser/shell_extensions_api_client.h" | 27 #include "extensions/shell/browser/shell_extensions_api_client.h" |
26 #include "extensions/shell/browser/shell_extensions_browser_client.h" | 28 #include "extensions/shell/browser/shell_extensions_browser_client.h" |
27 #include "extensions/shell/test/shell_test.h" | 29 #include "extensions/shell/test/shell_test.h" |
28 #include "extensions/test/extension_test_message_listener.h" | 30 #include "extensions/test/extension_test_message_listener.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 123 } |
122 | 124 |
123 void RunTest(const std::string& test_name, | 125 void RunTest(const std::string& test_name, |
124 const std::string& app_location, | 126 const std::string& app_location, |
125 const std::string& app_to_embed) { | 127 const std::string& app_to_embed) { |
126 const Extension* app_embedder = LoadApp(app_location); | 128 const Extension* app_embedder = LoadApp(app_location); |
127 ASSERT_TRUE(app_embedder); | 129 ASSERT_TRUE(app_embedder); |
128 const Extension* app_embedded = LoadApp(app_to_embed); | 130 const Extension* app_embedded = LoadApp(app_to_embed); |
129 ASSERT_TRUE(app_embedded); | 131 ASSERT_TRUE(app_embedded); |
130 | 132 |
131 extension_system_->LaunchApp(app_embedder->id()); | 133 apps::LaunchPlatformApp(browser_context_, app_embedder, |
| 134 extensions::SOURCE_UNTRACKED); |
132 | 135 |
133 ExtensionTestMessageListener launch_listener("LAUNCHED", false); | 136 ExtensionTestMessageListener launch_listener("LAUNCHED", false); |
134 ASSERT_TRUE(launch_listener.WaitUntilSatisfied()); | 137 ASSERT_TRUE(launch_listener.WaitUntilSatisfied()); |
135 | 138 |
136 embedder_web_contents_ = GetFirstAppWindowWebContents(); | 139 embedder_web_contents_ = GetFirstAppWindowWebContents(); |
137 | 140 |
138 ExtensionTestMessageListener done_listener("TEST_PASSED", false); | 141 ExtensionTestMessageListener done_listener("TEST_PASSED", false); |
139 done_listener.set_failure_message("TEST_FAILED"); | 142 done_listener.set_failure_message("TEST_FAILED"); |
140 ASSERT_TRUE( | 143 ASSERT_TRUE( |
141 content::ExecuteScript(embedder_web_contents_, | 144 content::ExecuteScript(embedder_web_contents_, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 #endif | 218 #endif |
216 // Tests that <appview> is able to navigate to another installed app. | 219 // Tests that <appview> is able to navigate to another installed app. |
217 IN_PROC_BROWSER_TEST_P(AppViewTest, | 220 IN_PROC_BROWSER_TEST_P(AppViewTest, |
218 MAYBE_TestAppViewWithUndefinedDataShouldSucceed) { | 221 MAYBE_TestAppViewWithUndefinedDataShouldSucceed) { |
219 RunTest("testAppViewWithUndefinedDataShouldSucceed", | 222 RunTest("testAppViewWithUndefinedDataShouldSucceed", |
220 "app_view/apitest", | 223 "app_view/apitest", |
221 "app_view/apitest/skeleton"); | 224 "app_view/apitest/skeleton"); |
222 } | 225 } |
223 | 226 |
224 } // namespace extensions | 227 } // namespace extensions |
OLD | NEW |