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

Unified Diff: extensions/test/data/web_view/apitest/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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_find_helper.cc ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/data/web_view/apitest/main.js
diff --git a/extensions/test/data/web_view/apitest/main.js b/extensions/test/data/web_view/apitest/main.js
index 0ea11fa2bc97e0aaf052ad8d200c5eecf2054b67..38aa6b1e05f81bbf704c5743204ebd719da7f040 100644
--- a/extensions/test/data/web_view/apitest/main.js
+++ b/extensions/test/data/web_view/apitest/main.js
@@ -739,13 +739,22 @@ function testFindAPI() {
var loadstopListener2 = function(e) {
embedder.test.assertEq(webview.src, "about:blank");
- embedder.test.succeed();
+ // Test find results when looking for nothing.
+ webview.find("", {}, function(results) {
+ embedder.test.assertEq(results.numberOfMatches, 0);
+ embedder.test.assertEq(results.activeMatchOrdinal, 0);
+ embedder.test.assertEq(results.selectionRect.left, 0);
+ embedder.test.assertEq(results.selectionRect.top, 0);
+ embedder.test.assertEq(results.selectionRect.width, 0);
+ embedder.test.assertEq(results.selectionRect.height, 0);
+
+ embedder.test.succeed();
+ });
}
var loadstopListener1 = function(e) {
// Test find results.
webview.find("dog", {}, function(results) {
- callbackTest = true;
embedder.test.assertEq(results.numberOfMatches, 100);
embedder.test.assertTrue(results.selectionRect.width > 0);
embedder.test.assertTrue(results.selectionRect.height > 0);
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_find_helper.cc ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698