Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_apitest.cc

Issue 634403003: Adding webview tests to app_shell_browsertest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "content/public/browser/render_process_host.h" 11 #include "content/public/browser/render_process_host.h"
12 #include "content/public/common/content_switches.h"
12 #include "content/public/test/browser_test_utils.h" 13 #include "content/public/test/browser_test_utils.h"
13 #include "content/public/test/test_utils.h" 14 #include "content/public/test/test_utils.h"
14 #include "extensions/browser/api/test/test_api.h" 15 #include "extensions/browser/api/test/test_api.h"
15 #include "extensions/browser/app_window/app_window.h" 16 #include "extensions/browser/app_window/app_window.h"
16 #include "extensions/browser/app_window/app_window_registry.h" 17 #include "extensions/browser/app_window/app_window_registry.h"
17 #include "extensions/browser/extension_host.h" 18 #include "extensions/browser/extension_host.h"
18 #include "extensions/browser/guest_view/guest_view_manager.h" 19 #include "extensions/browser/guest_view/guest_view_manager.h"
19 #include "extensions/browser/guest_view/guest_view_manager_factory.h" 20 #include "extensions/browser/guest_view/guest_view_manager_factory.h"
20 #include "extensions/browser/guest_view/test_guest_view_manager.h" 21 #include "extensions/browser/guest_view/test_guest_view_manager.h"
21 #include "extensions/browser/process_manager.h" 22 #include "extensions/browser/process_manager.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 return; 117 return;
117 } 118 }
118 ASSERT_TRUE(done_listener.WaitUntilSatisfied()); 119 ASSERT_TRUE(done_listener.WaitUntilSatisfied());
119 } 120 }
120 121
121 void WebViewAPITest::RunTestOnMainThreadLoop() { 122 void WebViewAPITest::RunTestOnMainThreadLoop() {
122 AppShellTest::RunTestOnMainThreadLoop(); 123 AppShellTest::RunTestOnMainThreadLoop();
123 GetGuestViewManager()->WaitForAllGuestsDeleted(); 124 GetGuestViewManager()->WaitForAllGuestsDeleted();
124 } 125 }
125 126
127 void WebViewAPITest::SetUpCommandLine(base::CommandLine* command_line) {
128 AppShellTest::SetUpCommandLine(command_line);
129 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc");
130 }
131
126 void WebViewAPITest::SetUpOnMainThread() { 132 void WebViewAPITest::SetUpOnMainThread() {
127 AppShellTest::SetUpOnMainThread(); 133 AppShellTest::SetUpOnMainThread();
128 134
129 TestGetConfigFunction::set_test_config_state(&test_config_); 135 TestGetConfigFunction::set_test_config_state(&test_config_);
130 base::FilePath test_data_dir; 136 base::FilePath test_data_dir;
131 test_config_.SetInteger(kTestWebSocketPort, 0); 137 test_config_.SetInteger(kTestWebSocketPort, 0);
132 } 138 }
133 139
134 void WebViewAPITest::StartTestServer() { 140 void WebViewAPITest::StartTestServer() {
135 // For serving guest pages. 141 // For serving guest pages.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 TestDeclarativeWebRequestAPISendMessage) { 250 TestDeclarativeWebRequestAPISendMessage) {
245 StartTestServer(); 251 StartTestServer();
246 RunTest("testDeclarativeWebRequestAPISendMessage", "web_view/apitest"); 252 RunTest("testDeclarativeWebRequestAPISendMessage", "web_view/apitest");
247 StopTestServer(); 253 StopTestServer();
248 } 254 }
249 255
250 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDestroyOnEventListener) { 256 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDestroyOnEventListener) {
251 RunTest("testDestroyOnEventListener", "web_view/apitest"); 257 RunTest("testDestroyOnEventListener", "web_view/apitest");
252 } 258 }
253 259
260 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDialogAlert) {
261 RunTest("testDialogAlert", "web_view/dialog");
262 }
263
264 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDialogConfirm) {
265 RunTest("testDialogConfirm", "web_view/dialog");
266 }
267
268 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDialogConfirmCancel) {
269 RunTest("testDialogConfirmCancel", "web_view/dialog");
270 }
271
272 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDialogConfirmDefaultCancel) {
273 RunTest("testDialogConfirmDefaultCancel", "web_view/dialog");
274 }
275
276 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDialogConfirmDefaultGCCancel) {
277 RunTest("testDialogConfirmDefaultGCCancel", "web_view/dialog");
278 }
279
280 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDialogPrompt) {
281 RunTest("testDialogPrompt", "web_view/dialog");
282 }
283
254 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDisplayNoneWebviewLoad) { 284 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestDisplayNoneWebviewLoad) {
255 RunTest("testDisplayNoneWebviewLoad", "web_view/apitest"); 285 RunTest("testDisplayNoneWebviewLoad", "web_view/apitest");
256 } 286 }
257 287
258 // TODO(lfg): Re-enable this test once the fix for webview leaking 288 // TODO(lfg): Re-enable this test once the fix for webview leaking
259 // RenderProcessHost has landed. See http://crbug.com/419020 . 289 // RenderProcessHost has landed. See http://crbug.com/419020 .
260 IN_PROC_BROWSER_TEST_F(WebViewAPITest, 290 IN_PROC_BROWSER_TEST_F(WebViewAPITest,
261 DISABLED_TestDisplayNoneWebviewRemoveChild) { 291 DISABLED_TestDisplayNoneWebviewRemoveChild) {
262 RunTest("testDisplayNoneWebviewRemoveChild", "web_view/apitest"); 292 RunTest("testDisplayNoneWebviewRemoveChild", "web_view/apitest");
263 } 293 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 // object, on the webview element, and hanging directly off webview. 503 // object, on the webview element, and hanging directly off webview.
474 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIExistence) { 504 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIExistence) {
475 RunTest("testWebRequestAPIExistence", "web_view/apitest"); 505 RunTest("testWebRequestAPIExistence", "web_view/apitest");
476 } 506 }
477 507
478 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIGoogleProperty) { 508 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIGoogleProperty) {
479 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); 509 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest");
480 } 510 }
481 511
482 } // namespace extensions 512 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_apitest.h ('k') | extensions/shell/test/shell_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698