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

Unified Diff: chrome/test/data/extensions/platform_apps/ad_view/loadcommit_event/chrometest.js

Issue 12967016: Improve <adview> implementation and add tests. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Disable test with dependency on binary file. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/platform_apps/ad_view/loadcommit_event/chrometest.js
diff --git a/chrome/test/data/extensions/platform_apps/ad_view/loadcommit_event/chrometest.js b/chrome/test/data/extensions/platform_apps/ad_view/loadcommit_event/chrometest.js
new file mode 100644
index 0000000000000000000000000000000000000000..b7d65c13b3085d6b4c2bb78f6fecb82f2ac66d86
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/ad_view/loadcommit_event/chrometest.js
@@ -0,0 +1,33 @@
+// 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.
+
+// This test checks the "loadcommit" event is called when the page inside an
+// <adview> is loaded.
+
+function runTests(guestURL) {
+ chrome.test.runTests([
+ function test() {
+ var adview = document.getElementsByTagName("adview")[0];
+
+ adview.addEventListener("loadcommit", function(event) {
+ var url = event.url;
+ var isTopLevel = event.isTopLevel;
+ chrome.test.assertEq(guestURL, url);
+ chrome.test.assertEq(true, isTopLevel);
+ console.log("loadcommit event called: url=" + url);
+ chrome.test.succeed();
+ })
+
+ adview.setAttribute("src", guestURL);
+ }
+ ]);
+}
+
+window.onload = function() {
+ chrome.test.getConfig(function(config) {
+ var guestURL = 'http://localhost:' + config.testServer.port +
+ '/files/extensions/platform_apps/ad_view/ad_network_site/testsdk.html';
+ runTests(guestURL);
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698