OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/renderer/extensions/extension_process_bindings.h" | 10 #include "chrome/renderer/extensions/extension_process_bindings.h" |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 ExpectJsFail("chrome.i18n.getAcceptLanguages()", | 598 ExpectJsFail("chrome.i18n.getAcceptLanguages()", |
599 "Uncaught Error: Parameter 0 is required."); | 599 "Uncaught Error: Parameter 0 is required."); |
600 | 600 |
601 ExpectJsFail("chrome.i18n.getAcceptLanguages('abc')", | 601 ExpectJsFail("chrome.i18n.getAcceptLanguages('abc')", |
602 "Uncaught Error: Invalid value for argument 0. " | 602 "Uncaught Error: Invalid value for argument 0. " |
603 "Expected 'function' but got 'string'."); | 603 "Expected 'function' but got 'string'."); |
604 | 604 |
605 ExpectJsPass("chrome.i18n.getAcceptLanguages(function(){})", | 605 ExpectJsPass("chrome.i18n.getAcceptLanguages(function(){})", |
606 "i18n.getAcceptLanguages", "null"); | 606 "i18n.getAcceptLanguages", "null"); |
607 } | 607 } |
| 608 |
| 609 TEST_F(ExtensionAPIClientTest, GetL10nMessage) { |
| 610 ExpectJsFail("chrome.i18n.getMessage()", |
| 611 "Uncaught Error: Parameter 0 is required."); |
| 612 |
| 613 ExpectJsFail("chrome.i18n.getMessage(1)", |
| 614 "Uncaught Error: Invalid value for argument 0. " |
| 615 "Expected 'string' but got 'integer'."); |
| 616 |
| 617 ExpectJsFail("chrome.i18n.getMessage('name', [])", |
| 618 "Uncaught Error: Invalid value for argument 1. Value does not " |
| 619 "match any valid type choices."); |
| 620 |
| 621 ExpectJsFail("chrome.i18n.getMessage('name', ['p1', 'p2', 'p3', 'p4', 'p5', " |
| 622 "'p6', 'p7', 'p8', 'p9', 'p10'])", |
| 623 "Uncaught Error: Invalid value for argument 1. Value does not " |
| 624 "match any valid type choices."); |
| 625 } |
OLD | NEW |