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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 test_config_.SetString(kTestDataDirectory, | 136 test_config_.SetString(kTestDataDirectory, |
137 net::FilePathToFileURL(test_data_dir).spec()); | 137 net::FilePathToFileURL(test_data_dir).spec()); |
138 | 138 |
139 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); | 139 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); |
140 | 140 |
141 const Extension* extension = extension_system_->LoadApp(test_data_dir); | 141 const Extension* extension = extension_system_->LoadApp(test_data_dir); |
142 ASSERT_TRUE(extension); | 142 ASSERT_TRUE(extension); |
143 extension_system_->LaunchApp(extension->id()); | 143 extension_system_->LaunchApp(extension->id()); |
144 | 144 |
145 ExtensionTestMessageListener launch_listener("LAUNCHED", false); | 145 ExtensionTestMessageListener launch_listener("LAUNCHED", false); |
| 146 launch_listener.set_failure_message("FAILURE"); |
146 ASSERT_TRUE(launch_listener.WaitUntilSatisfied()); | 147 ASSERT_TRUE(launch_listener.WaitUntilSatisfied()); |
147 | 148 |
148 embedder_web_contents_ = GetFirstAppWindowWebContents(); | 149 embedder_web_contents_ = GetFirstAppWindowWebContents(); |
149 } | 150 } |
150 | 151 |
151 content::WebContents* WebViewAPITest::GetFirstAppWindowWebContents() { | 152 content::WebContents* WebViewAPITest::GetFirstAppWindowWebContents() { |
152 const AppWindowRegistry::AppWindowList& app_window_list = | 153 const AppWindowRegistry::AppWindowList& app_window_list = |
153 AppWindowRegistry::Get(browser_context_)->app_windows(); | 154 AppWindowRegistry::Get(browser_context_)->app_windows(); |
154 DCHECK(app_window_list.size() == 1); | 155 DCHECK(app_window_list.size() == 1); |
155 return (*app_window_list.begin())->web_contents(); | 156 return (*app_window_list.begin())->web_contents(); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 // Tests the existence of WebRequest API event objects on the request | 699 // Tests the existence of WebRequest API event objects on the request |
699 // object, on the webview element, and hanging directly off webview. | 700 // object, on the webview element, and hanging directly off webview. |
700 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIExistence) { | 701 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIExistence) { |
701 RunTest("testWebRequestAPIExistence", "web_view/apitest"); | 702 RunTest("testWebRequestAPIExistence", "web_view/apitest"); |
702 } | 703 } |
703 | 704 |
704 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIGoogleProperty) { | 705 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIGoogleProperty) { |
705 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); | 706 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); |
706 } | 707 } |
707 | 708 |
| 709 // This test verifies that webview.contentWindow works inside an iframe |
| 710 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) { |
| 711 LaunchApp("web_view/inside_iframe"); |
| 712 } |
| 713 |
| 714 |
708 } // namespace extensions | 715 } // namespace extensions |
OLD | NEW |