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

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

Issue 2857953004: Fix for flaky WebViewTest.Shim_TestFindAPI_findupdate test on msan bots. (Closed)
Patch Set: Added TODO. Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2647 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 }); 2658 });
2659 }); 2659 });
2660 }); 2660 });
2661 }); 2661 });
2662 }; 2662 };
2663 2663
2664 webview.addEventListener('loadstop', loadstopListener1); 2664 webview.addEventListener('loadstop', loadstopListener1);
2665 document.body.appendChild(webview); 2665 document.body.appendChild(webview);
2666 }; 2666 };
2667 2667
2668 // TODO(paulmeyer): Make sure this test is not still flaky. If it is, it is
2669 // likely because the search for "dog" compelted too quickly. crbug.com/710486.
2668 function testFindAPI_findupdate() { 2670 function testFindAPI_findupdate() {
2669 var webview = new WebView(); 2671 var webview = new WebView();
2670 webview.src = testFindPage; 2672 webview.src = testFindPage;
2671 2673
2672 var canceledTest = false; 2674 var canceledTest = false;
2673 webview.addEventListener('loadstop', function(e) { 2675 webview.addEventListener('loadstop', function(e) {
2674 // Test the |findupdate| event. 2676 // Test the |findupdate| event.
2675 webview.addEventListener('findupdate', function(e) { 2677 webview.addEventListener('findupdate', function(e) {
2676 if (e.activeMatchOrdinal > 0) { 2678 if (e.activeMatchOrdinal > 0) {
2677 embedder.test.assertTrue(e.numberOfMatches >= e.activeMatchOrdinal) 2679 embedder.test.assertTrue(e.numberOfMatches >= e.activeMatchOrdinal)
2678 embedder.test.assertTrue(e.selectionRect.width > 0); 2680 embedder.test.assertTrue(e.selectionRect.width > 0);
2679 embedder.test.assertTrue(e.selectionRect.height > 0); 2681 embedder.test.assertTrue(e.selectionRect.height > 0);
2680 } 2682 }
2681 2683
2682 if (e.finalUpdate) { 2684 if (e.finalUpdate) {
2683 if (e.canceled) { 2685 if (e.canceled) {
2684 canceledTest = true; 2686 canceledTest = true;
2685 } else { 2687 } else {
2686 embedder.test.assertEq(e.searchText, "dog"); 2688 embedder.test.assertEq(e.searchText, "cat");
2687 embedder.test.assertEq(e.numberOfMatches, 100); 2689 embedder.test.assertEq(e.numberOfMatches, 10);
2688 embedder.test.assertEq(e.activeMatchOrdinal, 1); 2690 embedder.test.assertEq(e.activeMatchOrdinal, 1);
2689 embedder.test.assertTrue(canceledTest); 2691 embedder.test.assertTrue(canceledTest);
2690 embedder.test.succeed(); 2692 embedder.test.succeed();
2691 } 2693 }
2692 } 2694 }
2693 }); 2695 });
2694 webview.find("dog"); 2696 webview.find("dog");
2697 webview.find("dog");
2695 webview.find("cat"); 2698 webview.find("cat");
2696 webview.find("dog");
2697 }); 2699 });
2698 2700
2699 document.body.appendChild(webview); 2701 document.body.appendChild(webview);
2700 }; 2702 };
2701 2703
2702 function testFindInMultipleWebViews() { 2704 function testFindInMultipleWebViews() {
2703 var webviews = [new WebView(), new WebView(), new WebView()]; 2705 var webviews = [new WebView(), new WebView(), new WebView()];
2704 var promises = []; 2706 var promises = [];
2705 2707
2706 // Search in all WebViews simultaneously. 2708 // Search in all WebViews simultaneously.
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
3221 testRendererNavigationRedirectWhileUnattached, 3223 testRendererNavigationRedirectWhileUnattached,
3222 'testBlobURL': testBlobURL 3224 'testBlobURL': testBlobURL
3223 }; 3225 };
3224 3226
3225 onload = function() { 3227 onload = function() {
3226 chrome.test.getConfig(function(config) { 3228 chrome.test.getConfig(function(config) {
3227 embedder.setUp_(config); 3229 embedder.setUp_(config);
3228 chrome.test.sendMessage("Launched"); 3230 chrome.test.sendMessage("Launched");
3229 }); 3231 });
3230 }; 3232 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698