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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/simple/main.js

Issue 890183002: Allow Signin page to open other chrome:// URLs if login content in <webview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/platform_apps/web_view/simple/main.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/simple/main.js b/chrome/test/data/extensions/platform_apps/web_view/simple/main.js
new file mode 100644
index 0000000000000000000000000000000000000000..7e0648395a1d2d3db36a9b2bc03d581e8fe96823
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/web_view/simple/main.js
@@ -0,0 +1,40 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function CreateWebViewAndGuest(callback) {
+ var webview = document.createElement('webview');
+ var onLoadStop = function(e) {
+ chrome.test.sendMessage('WebViewTest.LAUNCHED');
+ webview.removeEventListener('loadstop', onLoadStop);
+ webview.removeEventListener('loadabort', onLoadAbort);
+ callback();
+ };
+ webview.addEventListener('loadstop', onLoadStop);
+
+ var onLoadAbort = function(e) {
+ chrome.test.sendMessage('WebViewTest.FAILURE');
+ webview.removeEventListener('loadstop', onLoadStop);
+ webview.removeEventListener('loadabort', onLoadAbort);
+ };
+ webview.src = 'data:text/html,<html><body>simple test</body></html>';
+ return webview;
+}
+
+onload = function() {
+ var webview = CreateWebViewAndGuest(function() {
+ webview.addEventListener('newwindow', function(e) {
+ var newwebview = document.createElement('webview');
+ newwebview.addEventListener('loadstop', function(e) {
+ chrome.test.sendMessage('WebViewTest.NEWWINDOW');
+ });
+ e.window.attach(newwebview);
+ document.body.appendChild(newwebview);
+ });
+
+ webview.addEventListener('loadstop', function(e) {
+ chrome.test.sendMessage('WebViewTest.LOADSTOP');
+ });
+ });
+ document.body.appendChild(webview);
+};

Powered by Google App Engine
This is Rietveld 408576698