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

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/download/embedder.js

Issue 14189014: Minor cleanup in web_view_browsertest and remove repetitive code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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 | « chrome/browser/extensions/web_view_browsertest.cc ('k') | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 embedder = {}; 5 var embedder = {};
6 embedder.baseGuestURL = ''; 6 embedder.baseGuestURL = '';
7 embedder.guestURL = ''; 7 embedder.guestURL = '';
8 8
9 /** @private */ 9 /** @private */
10 embedder.setUpGuest_ = function() { 10 embedder.setUpGuest_ = function() {
(...skipping 12 matching lines...) Expand all
23 var url = e.url; 23 var url = e.url;
24 if (url.indexOf('expect-deny.zip') != -1) { 24 if (url.indexOf('expect-deny.zip') != -1) {
25 e.request.deny(); 25 e.request.deny();
26 } else if (url.indexOf('expect-allow.zip') != -1) { 26 } else if (url.indexOf('expect-allow.zip') != -1) {
27 e.request.allow(); 27 e.request.allow();
28 } else { 28 } else {
29 // Ignore. 29 // Ignore.
30 } 30 }
31 } 31 }
32 }); 32 });
33 var loaded = false;
34 webview.addEventListener('loadstop', function(e) {
35 if (!loaded) {
36 loaded = true;
37 chrome.test.sendMessage('guest-loaded');
38 }
39 });
33 return webview; 40 return webview;
34 }; 41 };
35 42
36 onload = function() { 43 onload = function() {
37 chrome.test.getConfig(function(config) { 44 chrome.test.getConfig(function(config) {
38 embedder.baseGuestURL = 'http://localhost:' + config.testServer.port; 45 embedder.baseGuestURL = 'http://localhost:' + config.testServer.port;
39 embedder.guestURL = embedder.baseGuestURL + 46 embedder.guestURL = embedder.baseGuestURL +
40 '/files/extensions/platform_apps/web_view/download/guest.html'; 47 '/files/extensions/platform_apps/web_view/download/guest.html';
41 embedder.setUpGuest_(); 48 embedder.setUpGuest_();
42 }); 49 });
43 }; 50 };
OLDNEW
« no previous file with comments | « chrome/browser/extensions/web_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698