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

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: Change constness of iterators for android clang 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 694e48812a73a431fc854b8a0348c7898d43cfbd..4b9da2703d48c4a911d778ae2a3d5203fe04b0df 100644
--- a/chrome/test/data/webui/about_invalidations_browsertest.js
+++ b/chrome/test/data/webui/about_invalidations_browsertest.js
@@ -17,7 +17,7 @@ InvalidationsWebUITest.prototype = {
**/
browsePreload: 'chrome://invalidations',
runAccessibilityChecks: false,
- accessibilityIssuesAreErrors: false,
+ accessibilityIssuesAreErrors: false
};
// Test that registering an invalidations appears properly on the textarea.
@@ -55,8 +55,48 @@ TEST_F('InvalidationsWebUITest', 'testChangingInvalidationsState', function() {
'TRANSIENT_INVALIDATION_ERROR');
var isContained =
invalidationsLog.value.indexOf(
- 'Invalidations service state changed to '+
+ 'Invalidations service state changed to ' +
'"TRANSIENT_INVALIDATION_ERROR"') != -1;
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', '', '', ''];
+ // Register two objects ID with 'Fake' registrar
+ chrome.invalidations.updateIds('Fake', newDataType);
+ // Disable the Extensions ObjectId by only sending FAVICON_IMAGE
+ newDataType = [{ name: 'FAVICON_IMAGE', source: 1004}];
+ chrome.invalidations.updateIds('Fake', newDataType);
+
+ // Test that the two patterns are contained in the table.
+ var oidTable = $('objectsid-table-container');
+ var foundPattern1 = false;
+ var foundPattern2 = false;
+ for (var row = 0; row < oidTable.rows.length; row++) {
+ var pattern1Test = true;
+ var pattern2Test = true;
+ for (var cell = 0; cell < oidTable.rows[row].cells.length; cell++) {
+ pattern1Test = pattern1Test
+ && (pattern1[cell] == oidTable.rows[row].cells[cell].textContent);
+ pattern2Test = pattern2Test
+ && (pattern2[cell] == oidTable.rows[row].cells[cell].textContent);
+ }
+ if (pattern1Test)
+ expectEquals('greyed', oidTable.rows[row].className);
+ if (pattern2Test)
+ expectEquals('content', oidTable.rows[row].className);
+
+ foundPattern1 = foundPattern1 || pattern1Test;
+ foundPattern2 = foundPattern2 || pattern2Test;
+ if (foundPattern2)
+ expectTrue(foundPattern1, 'The entries were not ordererd');
+ }
+ expectTrue(foundPattern1 && foundPattern2, "couldn't find both objects ids");
+
+});
« no previous file with comments | « chrome/browser/ui/webui/invalidations_message_handler.cc ('k') | sync/internal_api/public/test/fake_sync_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698