Revert "Only store leading 13 bits of password hash."
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / identity / js_bindings / test.js
blob7cebc113310a115178bd50a4cd3af3787973e26f
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var assertEq = chrome.test.assertEq;
6 var assertTrue = chrome.test.assertTrue;
7 var fail = chrome.test.fail;
8 var succeed = chrome.test.succeed;
10 function checkIsDefined(prop) {
11 if (!chrome.identity) {
12 fail('chrome.identity is not defined');
13 return false;
15 if (!chrome.identity[prop]) {
16 fail('chrome.identity.' + prop + ' is not undefined');
17 return false;
19 return true;
22 var id = 'mnkdjmfihjjihdfnnoiojdccnnfkajpd';
23 var host = 'https://' + id + '.chromiumapp.org';
25 chrome.test.runTests([
27 function testGenerateRedirectURLWithPath() {
28 if (!checkIsDefined('getRedirectURL'))
29 return;
31 var url = chrome.identity.getRedirectURL('slashless/path');
32 assertEq(host + '/slashless/path', url);
34 var url = chrome.identity.getRedirectURL('/slash/path');
35 assertEq(host + '/slash/path', url);
37 succeed();
40 function testGenerateRedirectURLNoPath() {
41 if (!checkIsDefined('getRedirectURL'))
42 return;
44 var url = chrome.identity.getRedirectURL();
45 assertEq(host + '/', url);
47 succeed();
50 function testGenerateRedirectURLemptyPath() {
51 if (!checkIsDefined('getRedirectURL'))
52 return;
54 var url = chrome.identity.getRedirectURL('');
55 assertEq(host + '/', url);
57 succeed();
60 ]);