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

Unified Diff: chrome/test/data/extensions/api_test/tabs/on_updated/test.js

Issue 1156043002: chrome.tabs.onUpdated doesn't called with 'loading' twice. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/api_test/tabs/on_updated/test.js
diff --git a/chrome/test/data/extensions/api_test/tabs/on_updated/test.js b/chrome/test/data/extensions/api_test/tabs/on_updated/test.js
index 05bf7e97bbff827b125fda2d6680e74faccd20b7..1c89503968e2eba4b39e65188824881642398bb6 100644
--- a/chrome/test/data/extensions/api_test/tabs/on_updated/test.js
+++ b/chrome/test/data/extensions/api_test/tabs/on_updated/test.js
@@ -119,5 +119,53 @@ chrome.test.runTests([
]);
chrome.tabs.create({ url: getURL('favicon/a.html') });
+ },
+
+ function historyReplaceState() {
+ // No more events. Because replaceState doesn't change url.
+ expect([
+ { status: 'loading', url: getURL('historyReplaceState/a.html') },
+ { status: 'complete' }
+ ]);
+
+ chrome.tabs.create({ url: getURL('historyReplaceState/a.html') });
+ },
+
+ function historyReplaceStateUpdateUrl() {
+ // url status is updated. Because history.replaceState updates url.
+ expect([
+ { status: 'loading', url: getURL('historyReplaceStateUpdateUrl/a.html') },
+ { status: 'complete' },
+ { url: getURL('historyReplaceStateUpdateUrl/a.html#a') },
+ ]);
+
+ chrome.tabs.create({ url: getURL('historyReplaceStateUpdateUrl/a.html') });
+ },
+
+ function historyPushState() {
+ // - a.html starts loading and complete.
+ // - historyPushState doesn't updates current url.
+ expect([
+ { status: 'loading', url: getURL('historyPushState/a.html') },
+ { status: 'complete' },
+ { status: 'loading' },
+ { status: 'complete' },
+ ]);
+
+ chrome.tabs.create({ url: getURL('historyPushState/a.html') });
+ },
+
+ function historyPushStateUpdateUrl() {
+ // - a.html starts loading and complete.
+ // - historyPushState updates current url. so that 'loading' and 'complete'
+ // are fired with updated url.
+ expect([
+ { status: 'loading', url: getURL('historyPushStateUpdateUrl/a.html') },
+ { status: 'complete' },
+ { status: 'loading', url: getURL('historyPushStateUpdateUrl/a.html#a') },
+ { status: 'complete' },
+ ]);
+
+ chrome.tabs.create({ url: getURL('historyPushStateUpdateUrl/a.html') });
}
not at google - send to devlin 2015/07/01 15:57:15 Could you also test simple hash fragments, like lo
limasdf 2015/07/06 17:14:44 Done.
]);

Powered by Google App Engine
This is Rietveld 408576698