Chromium Code Reviews

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/shim/main.js

Issue 1365563003: Prevent guest views from issuing a search for empty text. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: parens Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 var util = {}; 5 var util = {};
6 var embedder = {}; 6 var embedder = {};
7 embedder.baseGuestURL = ''; 7 embedder.baseGuestURL = '';
8 embedder.emptyGuestURL = ''; 8 embedder.emptyGuestURL = '';
9 embedder.windowOpenGuestURL = ''; 9 embedder.windowOpenGuestURL = '';
10 embedder.noReferrerGuestURL = ''; 10 embedder.noReferrerGuestURL = '';
(...skipping 2459 matching lines...)
2470 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' + 2470 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' +
2471 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' + 2471 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' +
2472 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' + 2472 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' +
2473 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' + 2473 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' +
2474 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' + 2474 'Dog dog dog Dog dog dogcatDog dogDogdog.<br>' +
2475 'Dog dog dog Dog dog dogcatDog dogDogdog.<br><br>' + 2475 'Dog dog dog Dog dog dogcatDog dogDogdog.<br><br>' +
2476 '<a href="about:blank">Click here!</a>'; 2476 '<a href="about:blank">Click here!</a>';
2477 2477
2478 var loadstopListener2 = function(e) { 2478 var loadstopListener2 = function(e) {
2479 embedder.test.assertEq(webview.src, "about:blank"); 2479 embedder.test.assertEq(webview.src, "about:blank");
2480 embedder.test.succeed(); 2480 // Test find results when looking for nothing.
2481 webview.find("", {}, function(results) {
2482 embedder.test.assertEq(results.numberOfMatches, 0);
2483 embedder.test.assertEq(results.activeMatchOrdinal, 0);
2484 embedder.test.assertEq(results.selectionRect.left, 0);
2485 embedder.test.assertEq(results.selectionRect.top, 0);
2486 embedder.test.assertEq(results.selectionRect.width, 0);
2487 embedder.test.assertEq(results.selectionRect.height, 0);
2488
2489 embedder.test.succeed();
2490 });
2481 } 2491 }
2482 2492
2483 var loadstopListener1 = function(e) { 2493 var loadstopListener1 = function(e) {
2484 // Test find results. 2494 // Test find results.
2485 webview.find("dog", {}, function(results) { 2495 webview.find("dog", {}, function(results) {
2486 callbackTest = true;
2487 embedder.test.assertEq(results.numberOfMatches, 100); 2496 embedder.test.assertEq(results.numberOfMatches, 100);
2488 embedder.test.assertTrue(results.selectionRect.width > 0); 2497 embedder.test.assertTrue(results.selectionRect.width > 0);
2489 embedder.test.assertTrue(results.selectionRect.height > 0); 2498 embedder.test.assertTrue(results.selectionRect.height > 0);
2490 2499
2491 // Test finding next active matches. 2500 // Test finding next active matches.
2492 webview.find("dog"); 2501 webview.find("dog");
2493 webview.find("dog"); 2502 webview.find("dog");
2494 webview.find("dog"); 2503 webview.find("dog");
2495 webview.find("dog"); 2504 webview.find("dog");
2496 webview.find("dog", {}, function(results) { 2505 webview.find("dog", {}, function(results) {
(...skipping 512 matching lines...)
3009 'testRendererNavigationRedirectWhileUnattached': 3018 'testRendererNavigationRedirectWhileUnattached':
3010 testRendererNavigationRedirectWhileUnattached 3019 testRendererNavigationRedirectWhileUnattached
3011 }; 3020 };
3012 3021
3013 onload = function() { 3022 onload = function() {
3014 chrome.test.getConfig(function(config) { 3023 chrome.test.getConfig(function(config) {
3015 embedder.setUp_(config); 3024 embedder.setUp_(config);
3016 chrome.test.sendMessage("Launched"); 3025 chrome.test.sendMessage("Launched");
3017 }); 3026 });
3018 }; 3027 };
OLDNEW
« no previous file with comments | « android_webview/browser/find_helper.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine