Index: chrome/test/data/extensions/api_test/webstore_private/common.js |
diff --git a/chrome/test/data/extensions/api_test/webstore_private/common.js b/chrome/test/data/extensions/api_test/webstore_private/common.js |
index 7aa92fd2dc4207020c593926d726c7c11d3b58e1..c37af26a5b475a7336355f6cf7d9fbb58dcddfbe 100644 |
--- a/chrome/test/data/extensions/api_test/webstore_private/common.js |
+++ b/chrome/test/data/extensions/api_test/webstore_private/common.js |
@@ -96,3 +96,29 @@ function installAndCleanUp(installOptions, whileInstalled) { |
})); |
})); |
} |
+ |
+function getContinueUrl(callback) { |
+ chrome.test.getConfig(function(config) { |
+ callback('http://www.example.com:PORT/continue' |
+ .replace(/PORT/, config.spawnedTestServer.port)); |
+ }); |
+} |
+ |
+function expectSignInFailure(error, forced_continue_url) { |
+ getContinueUrl(function(continue_url) { |
+ if (forced_continue_url !== undefined) |
+ continue_url = forced_continue_url; |
+ |
+ chrome.test.runWithUserGesture(function() { |
+ chrome.webstorePrivate.signIn(continue_url, callbackFail(error)); |
+ }); |
+ }); |
+} |
+ |
+function expectUserIsAlreadySignedIn() { |
+ getContinueUrl(function(continue_url) { |
+ chrome.test.runWithUserGesture(function() { |
+ chrome.webstorePrivate.signIn(continue_url, callbackPass()); |
+ }); |
+ }); |
+} |