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 // i18n api test | 5 // i18n api test |
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.I18N --lib=browser_tests | 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.I18N --lib=browser_tests |
7 | 7 |
8 var testCallback = chrome.test.testCallback; | 8 var testCallback = chrome.test.testCallback; |
9 var callbackPass = chrome.test.callbackPass; | 9 var callbackPass = chrome.test.callbackPass; |
10 | 10 |
11 chrome.test.getConfig(function(config) { | 11 chrome.test.getConfig(function(config) { |
12 | 12 |
13 var TEST_FILE_URL = "http://localhost:PORT/files/extensions/test_file.html" | 13 var TEST_FILE_URL = "http://localhost:PORT/extensions/test_file.html" |
14 .replace(/PORT/, config.testServer.port); | 14 .replace(/PORT/, config.testServer.port); |
15 | 15 |
16 chrome.test.runTests([ | 16 chrome.test.runTests([ |
17 function getAcceptLanguages() { | 17 function getAcceptLanguages() { |
18 chrome.i18n.getAcceptLanguages(callbackPass(function(results) { | 18 chrome.i18n.getAcceptLanguages(callbackPass(function(results) { |
19 chrome.test.assertEq(results.length, 2); | 19 chrome.test.assertEq(results.length, 2); |
20 chrome.test.assertEq(results[0], "en-US"); | 20 chrome.test.assertEq(results[0], "en-US"); |
21 chrome.test.assertEq(results[1], "en"); | 21 chrome.test.assertEq(results[1], "en"); |
22 })); | 22 })); |
23 }, | 23 }, |
(...skipping 26 matching lines...) Expand all Loading... |
50 } | 50 } |
51 ); | 51 ); |
52 chrome.test.log("Creating tab..."); | 52 chrome.test.log("Creating tab..."); |
53 chrome.tabs.create({ | 53 chrome.tabs.create({ |
54 url: TEST_FILE_URL | 54 url: TEST_FILE_URL |
55 }); | 55 }); |
56 chrome.test.succeed(); | 56 chrome.test.succeed(); |
57 } | 57 } |
58 ]); | 58 ]); |
59 }); | 59 }); |
OLD | NEW |