summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/webui/about_invalidations_browsertest.js
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/data/webui/about_invalidations_browsertest.js')
-rw-r--r--chrome/test/data/webui/about_invalidations_browsertest.js44
1 files changed, 42 insertions, 2 deletions
diff --git a/chrome/test/data/webui/about_invalidations_browsertest.js b/chrome/test/data/webui/about_invalidations_browsertest.js
index 694e488..4b9da27 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");
+
+});