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

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

Issue 272573005: <webview>: Move NewWindow API to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_rename
Patch Set: Cleanup and fix tests Created 6 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
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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 embedder.test.fail(); 904 embedder.test.fail();
905 } 905 }
906 }); 906 });
907 webview.setAttribute('src', embedder.windowOpenGuestURL); 907 webview.setAttribute('src', embedder.windowOpenGuestURL);
908 document.body.appendChild(webview); 908 document.body.appendChild(webview);
909 } 909 }
910 910
911 function testNewWindowNoReferrerLink() { 911 function testNewWindowNoReferrerLink() {
912 var webview = document.createElement('webview'); 912 var webview = document.createElement('webview');
913 webview.addEventListener('newwindow', function(e) { 913 webview.addEventListener('newwindow', function(e) {
914 window.console.log('new window call');
lazyboy 2014/05/12 23:00:20 Remove
Fady Samuel 2014/05/13 18:59:02 Done.
914 e.preventDefault(); 915 e.preventDefault();
915 var newwebview = document.createElement('webview'); 916 var newwebview = document.createElement('webview');
916 newwebview.addEventListener('loadstop', function(evt) { 917 newwebview.addEventListener('loadstop', function(evt) {
917 // If the new window finishes loading, the test is successful. 918 // If the new window finishes loading, the test is successful.
918 embedder.test.succeed(); 919 embedder.test.succeed();
919 }); 920 });
920 document.body.appendChild(newwebview); 921 document.body.appendChild(newwebview);
921 // Attach the new window to the new <webview>. 922 // Attach the new window to the new <webview>.
922 e.window.attach(newwebview); 923 e.window.attach(newwebview);
923 }); 924 });
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 'testFindAPI': testFindAPI, 1574 'testFindAPI': testFindAPI,
1574 'testFindAPI_findupdate': testFindAPI 1575 'testFindAPI_findupdate': testFindAPI
1575 }; 1576 };
1576 1577
1577 onload = function() { 1578 onload = function() {
1578 chrome.test.getConfig(function(config) { 1579 chrome.test.getConfig(function(config) {
1579 embedder.setUp_(config); 1580 embedder.setUp_(config);
1580 chrome.test.sendMessage("Launched"); 1581 chrome.test.sendMessage("Launched");
1581 }); 1582 });
1582 }; 1583 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698