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

Unified Diff: chrome/test/data/webui/about_invalidations_browsertest.js

Issue 159773006: [invalidations] Added table with registered objectsIds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@about_invalidations_clean
Patch Set: Better OwnerName for PushMessage Created 6 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/webui/about_invalidations_browsertest.js
diff --git a/chrome/test/data/webui/about_invalidations_browsertest.js b/chrome/test/data/webui/about_invalidations_browsertest.js
index 70a8a3dfc1bdc243226bed5a2c0af13ea4d020be..4ca728a3c76ae38250141c092a27f9866cd72cec 100644
--- a/chrome/test/data/webui/about_invalidations_browsertest.js
+++ b/chrome/test/data/webui/about_invalidations_browsertest.js
@@ -60,3 +60,35 @@ TEST_F('InvalidationsWebUITest', 'testChangingInvalidationsState', function() {
expectTrue(isContained, 'Actual log is:' + invalidationsLog.value);
});
+// Test that objects ids appear on the table.
+TEST_F('InvalidationsWebUITest', 'testRegisteringNewIds', function() {
+ var newDataType = [
+ { name: 'EXTENSIONS', source: 1004},
+ { name: 'FAVICON_IMAGE', source: 1004},
+ ];
+ var pattern1 = ['Fake', '1004', 'EXTENSIONS', '0', '', '', ''];
+ var pattern2 = ['Fake', '1004', 'FAVICON_IMAGE', '0', '', '', ''];
+ chrome.invalidations.updateIds("Fake", newDataType);
+ var oidTable = $('objectsid-table-container');
+ expectEquals(3, oidTable.rows.length);
+ expectEquals('header', oidTable.rows[0].className);
+ expectEquals('content', oidTable.rows[1].className);
+ expectEquals('content', oidTable.rows[2].className);
+ expectEquals(7, oidTable.rows[1].cells.length);
+ expectEquals(7, oidTable.rows[2].cells.length);
+
+ // Row 0 is headers.
+ for (var j = 0; j < oidTable.rows[1].cells.length; j++) {
+ var cellContent = oidTable.rows[1].cells[j].textContent;
+ expectEquals(pattern1[j], cellContent);
+ }
+ for (var j = 0; j < oidTable.rows[2].cells.length; j++) {
+ var cellContent = oidTable.rows[2].cells[j].textContent;
+ expectEquals(pattern2[j], cellContent);
+ }
+ newDataType = [{ name: 'FAVICON_IMAGE', source: 1004}];
+ chrome.invalidations.updateIds("Fake", newDataType);
+ expectEquals('header', oidTable.rows[0].className);
+ expectEquals('greyed', oidTable.rows[1].className);
+ expectEquals('content', oidTable.rows[2].className);
+});

Powered by Google App Engine
This is Rietveld 408576698