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

Unified Diff: chrome/test/data/extensions/api_test/preferences_private/test.js

Issue 118413003: Add hook for extension to check sync status. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years 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/preferences_private/test.js
diff --git a/chrome/test/data/extensions/api_test/preferences_private/test.js b/chrome/test/data/extensions/api_test/preferences_private/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..06510587f47d657a385f3a15805874ee88c882d0
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/preferences_private/test.js
@@ -0,0 +1,25 @@
+// Copyright 2013 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.
+
+chrome.test.runTests([function() {
+ chrome.preferencesPrivate.getSyncCategoriesWithoutPassphrase(
+ function(categories) {
not at google - send to devlin 2013/12/18 22:30:37 use chrome.test.callbackPass(function(categories)
Rune Fevang 2013/12/19 00:13:43 Done.
+ var bookmarks_found = false;
+ var preferences_found = false;
+ for (var i = 0; i < categories.length; i++) {
+ if (categories[i] === "Bookmarks")
+ bookmarks_found = true;
+ else if (categories[i] === "Preferences")
+ preferences_found = true;
+ else if (categories[i] === "Autofill")
+ chrome.test.fail("Autofill present even though it's encrypted");
+ else if (categories[i] === "Typed URLs")
+ chrome.test.fail("Typed URLs present even though it's not synced");
+ }
not at google - send to devlin 2013/12/18 22:30:37 Could you do like: chrome.test.assertTrue(categor
Rune Fevang 2013/12/19 00:13:43 Done, except I don't want to make any assumptions
+ chrome.test.assertTrue(bookmarks_found, "Bookmarks is missing.");
+ chrome.test.assertTrue(preferences_found, "Preferences is missing.");
+ chrome.test.succeed();
not at google - send to devlin 2013/12/18 22:30:37 ... and you won't need the succeed() at the end he
Rune Fevang 2013/12/19 00:13:43 Done.
+ }
+ );
+}]);

Powered by Google App Engine
This is Rietveld 408576698