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/browser/guest_view/web_view/web_view_apitest.h" | 5 #include "extensions/browser/guest_view/web_view/web_view_apitest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void WebViewAPITest::LaunchApp(const std::string& app_location) { | 133 void WebViewAPITest::LaunchApp(const std::string& app_location) { |
134 base::FilePath test_data_dir; | 134 base::FilePath test_data_dir; |
135 PathService::Get(DIR_TEST_DATA, &test_data_dir); | 135 PathService::Get(DIR_TEST_DATA, &test_data_dir); |
136 test_data_dir = test_data_dir.AppendASCII(app_location.c_str()); | 136 test_data_dir = test_data_dir.AppendASCII(app_location.c_str()); |
137 | 137 |
138 test_config_.SetString(kTestDataDirectory, | 138 test_config_.SetString(kTestDataDirectory, |
139 net::FilePathToFileURL(test_data_dir).spec()); | 139 net::FilePathToFileURL(test_data_dir).spec()); |
140 | 140 |
141 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); | 141 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); |
142 | 142 |
143 ASSERT_TRUE(extension_system_->LoadApp(test_data_dir)); | 143 const Extension* extension = extension_system_->LoadApp(test_data_dir); |
144 extension_system_->LaunchApp(); | 144 ASSERT_TRUE(extension); |
| 145 extension_system_->LaunchApp(extension->id()); |
145 | 146 |
146 ExtensionTestMessageListener launch_listener("LAUNCHED", false); | 147 ExtensionTestMessageListener launch_listener("LAUNCHED", false); |
147 ASSERT_TRUE(launch_listener.WaitUntilSatisfied()); | 148 ASSERT_TRUE(launch_listener.WaitUntilSatisfied()); |
148 | 149 |
149 embedder_web_contents_ = GetFirstAppWindowWebContents(); | 150 embedder_web_contents_ = GetFirstAppWindowWebContents(); |
150 } | 151 } |
151 | 152 |
152 content::WebContents* WebViewAPITest::GetFirstAppWindowWebContents() { | 153 content::WebContents* WebViewAPITest::GetFirstAppWindowWebContents() { |
153 const AppWindowRegistry::AppWindowList& app_window_list = | 154 const AppWindowRegistry::AppWindowList& app_window_list = |
154 AppWindowRegistry::Get(browser_context_)->app_windows(); | 155 AppWindowRegistry::Get(browser_context_)->app_windows(); |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 // object, on the webview element, and hanging directly off webview. | 703 // object, on the webview element, and hanging directly off webview. |
703 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIExistence) { | 704 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIExistence) { |
704 RunTest("testWebRequestAPIExistence", "web_view/apitest"); | 705 RunTest("testWebRequestAPIExistence", "web_view/apitest"); |
705 } | 706 } |
706 | 707 |
707 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIGoogleProperty) { | 708 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIGoogleProperty) { |
708 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); | 709 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); |
709 } | 710 } |
710 | 711 |
711 } // namespace extensions | 712 } // namespace extensions |
OLD | NEW |