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

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

Issue 10387074: Only disallow top-level navigations in platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mike's review feedback Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/platform_apps/iframes/main.js
diff --git a/chrome/test/data/extensions/platform_apps/iframes/main.js b/chrome/test/data/extensions/platform_apps/iframes/main.js
new file mode 100644
index 0000000000000000000000000000000000000000..e5b245de4b6de09bfd9be6eb566f2e0ebe945fe2
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/iframes/main.js
@@ -0,0 +1,43 @@
+// Copyright (c) 2012 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.
+
+chrome.test.getConfig(function(config) {
+ var LOCAL_URL = 'local-iframe.html';
+ var DATA_URL = 'data:text/plain,This frame should be displayed.';
+ var REMOTE_URL = 'http://localhost:' + config.testServer.port
+ '/files/extensions/platform_apps/iframes/remote-iframe.html';
+
+ chrome.test.runTests([
+ function localIframe() {
+ var iframe = document.createElement('iframe');
+ iframe.onload = chrome.test.callbackPass(function() {
+ console.log('Local iframe loaded');
+ });
+ iframe.src = LOCAL_URL;
+ document.body.appendChild(iframe);
+ },
+
+ function dataUrlIframe() {
+ var iframe = document.createElement('iframe');
+ iframe.onload = chrome.test.callbackPass(function() {
+ console.log('data: URL iframe loaded');
+ });
+ iframe.src = DATA_URL;
+ document.body.appendChild(iframe);
+ },
+
+ function remoteIframe() {
+ var iframe = document.createElement('iframe');
+ iframe.onload = function() {
+ chrome.test.notifyFail('Remote iframe should not have loaded');
+ };
+ iframe.src = REMOTE_URL;
+ document.body.appendChild(iframe);
+
+ // Load failure should happen synchronously, but wait a bit before
+ // declaring success.
+ setTimeout(chrome.test.succeed, 500);
+ }
+ ]);
+});

Powered by Google App Engine
This is Rietveld 408576698