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

Unified Diff: chrome/test/data/extensions/api_test/webnavigation/test_filtered.js

Issue 10514013: Filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, reland Created 8 years, 5 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
« no previous file with comments | « chrome/test/data/extensions/api_test/webnavigation/test_filtered.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/webnavigation/test_filtered.js
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_filtered.js b/chrome/test/data/extensions/api_test/webnavigation/test_filtered.js
new file mode 100644
index 0000000000000000000000000000000000000000..b262b924ca0ea47bcda91646a9d051cf634baad7
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_filtered.js
@@ -0,0 +1,28 @@
+// 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.
+
+function runTests() {
+ var getURL = chrome.extension.getURL;
+ chrome.tabs.create({"url": "about:blank"}, function(tab) {
+ var tabId = tab.id;
+ chrome.test.runTests([
+ function dontGetEventToWrongUrl() {
+ var a_visited = false;
+ chrome.webNavigation.onCommitted.addListener(function(details) {
+ chrome.test.fail();
+ }, { url: [{pathSuffix: 'never-navigated.html'}] });
+ chrome.webNavigation.onCommitted.addListener(function(details) {
+ chrome.test.assertTrue(details.url == getURL('filtered/a.html'));
+ a_visited = true;
+ }, { url: [{pathSuffix: 'a.html'}] });
+ chrome.webNavigation.onCommitted.addListener(function(details) {
+ chrome.test.assertTrue(details.url == getURL('filtered/b.html'));
+ chrome.test.assertTrue(a_visited);
+ chrome.test.succeed();
+ }, { url: [{pathSuffix: 'b.html'}] });
+ chrome.tabs.update(tabId, { url: getURL('filtered/a.html') });
+ }
+ ]);
+ });
+}
« no previous file with comments | « chrome/test/data/extensions/api_test/webnavigation/test_filtered.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698