OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The id of an extension we're using for install tests. | 5 // The id of an extension we're using for install tests. |
6 var extensionId = "enfkhcelefdadlmkffamgdlgplcionje"; | 6 var extensionId = "enfkhcelefdadlmkffamgdlgplcionje"; |
7 | 7 |
8 // The id of an app we're using for install tests. | 8 // The id of an app we're using for install tests. |
9 var appId = "iladmdjkfniedhfhcfoefgojhgaiaccc"; | 9 var appId = "iladmdjkfniedhfhcfoefgojhgaiaccc"; |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 assertEq(undefined, result); | 89 assertEq(undefined, result); |
90 | 90 |
91 whileInstalled(); | 91 whileInstalled(); |
92 | 92 |
93 chrome.test.runWithUserGesture(callbackPass(function() { | 93 chrome.test.runWithUserGesture(callbackPass(function() { |
94 chrome.management.uninstall(extensionId, {}, callbackPass()); | 94 chrome.management.uninstall(extensionId, {}, callbackPass()); |
95 })); | 95 })); |
96 })); | 96 })); |
97 })); | 97 })); |
98 } | 98 } |
99 | |
100 function getContinueUrl(callback) { | |
101 chrome.test.getConfig(function(config) { | |
102 callback('http://www.example.com:PORT/continue' | |
103 .replace(/PORT/, config.spawnedTestServer.port)); | |
104 }); | |
105 } | |
106 | |
107 function expectSignInFailure(error, forced_continue_url) { | |
108 getContinueUrl(function(continue_url) { | |
109 if (forced_continue_url !== undefined) | |
110 continue_url = forced_continue_url; | |
111 | |
112 chrome.test.runWithUserGesture(function() { | |
113 chrome.webstorePrivate.signIn(continue_url, callbackFail(error)); | |
114 }); | |
115 }); | |
116 } | |
117 | |
118 function expectUserIsAlreadySignedIn() { | |
119 getContinueUrl(function(continue_url) { | |
120 chrome.test.runWithUserGesture(function() { | |
121 chrome.webstorePrivate.signIn(continue_url, callbackPass()); | |
122 }); | |
123 }); | |
124 } | |
OLD | NEW |