| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/threading/thread_restrictions.h" |
| 8 #include "components/guest_view/browser/guest_view_manager.h" | 9 #include "components/guest_view/browser/guest_view_manager.h" |
| 9 #include "components/guest_view/browser/guest_view_manager_factory.h" | 10 #include "components/guest_view/browser/guest_view_manager_factory.h" |
| 10 #include "components/guest_view/browser/test_guest_view_manager.h" | 11 #include "components/guest_view/browser/test_guest_view_manager.h" |
| 11 #include "content/public/common/content_features.h" | 12 #include "content/public/common/content_features.h" |
| 12 #include "content/public/common/content_switches.h" | 13 #include "content/public/common/content_switches.h" |
| 13 #include "content/public/test/browser_test.h" | 14 #include "content/public/test/browser_test.h" |
| 14 #include "content/public/test/browser_test_utils.h" | 15 #include "content/public/test/browser_test_utils.h" |
| 15 #include "content/public/test/test_utils.h" | 16 #include "content/public/test/test_utils.h" |
| 16 #include "extensions/browser/app_window/app_window.h" | 17 #include "extensions/browser/app_window/app_window.h" |
| 17 #include "extensions/browser/app_window/app_window_registry.h" | 18 #include "extensions/browser/app_window/app_window_registry.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 106 } |
| 106 | 107 |
| 107 content::WebContents* GetFirstAppWindowWebContents() { | 108 content::WebContents* GetFirstAppWindowWebContents() { |
| 108 const AppWindowRegistry::AppWindowList& app_window_list = | 109 const AppWindowRegistry::AppWindowList& app_window_list = |
| 109 AppWindowRegistry::Get(browser_context_)->app_windows(); | 110 AppWindowRegistry::Get(browser_context_)->app_windows(); |
| 110 DCHECK(app_window_list.size() == 1); | 111 DCHECK(app_window_list.size() == 1); |
| 111 return (*app_window_list.begin())->web_contents(); | 112 return (*app_window_list.begin())->web_contents(); |
| 112 } | 113 } |
| 113 | 114 |
| 114 const Extension* LoadApp(const std::string& app_location) { | 115 const Extension* LoadApp(const std::string& app_location) { |
| 116 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 115 base::FilePath test_data_dir; | 117 base::FilePath test_data_dir; |
| 116 PathService::Get(DIR_TEST_DATA, &test_data_dir); | 118 PathService::Get(DIR_TEST_DATA, &test_data_dir); |
| 117 test_data_dir = test_data_dir.AppendASCII(app_location.c_str()); | 119 test_data_dir = test_data_dir.AppendASCII(app_location.c_str()); |
| 118 return extension_system_->LoadApp(test_data_dir); | 120 return extension_system_->LoadApp(test_data_dir); |
| 119 } | 121 } |
| 120 | 122 |
| 121 void RunTest(const std::string& test_name, | 123 void RunTest(const std::string& test_name, |
| 122 const std::string& app_location, | 124 const std::string& app_location, |
| 123 const std::string& app_to_embed) { | 125 const std::string& app_to_embed) { |
| 124 const Extension* app_embedder = LoadApp(app_location); | 126 const Extension* app_embedder = LoadApp(app_location); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 #endif | 215 #endif |
| 214 // Tests that <appview> is able to navigate to another installed app. | 216 // Tests that <appview> is able to navigate to another installed app. |
| 215 IN_PROC_BROWSER_TEST_P(AppViewTest, | 217 IN_PROC_BROWSER_TEST_P(AppViewTest, |
| 216 MAYBE_TestAppViewWithUndefinedDataShouldSucceed) { | 218 MAYBE_TestAppViewWithUndefinedDataShouldSucceed) { |
| 217 RunTest("testAppViewWithUndefinedDataShouldSucceed", | 219 RunTest("testAppViewWithUndefinedDataShouldSucceed", |
| 218 "app_view/apitest", | 220 "app_view/apitest", |
| 219 "app_view/apitest/skeleton"); | 221 "app_view/apitest/skeleton"); |
| 220 } | 222 } |
| 221 | 223 |
| 222 } // namespace extensions | 224 } // namespace extensions |
| OLD | NEW |