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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 ExpectJsFail("chrome.toolstrip.collapse(1)", | 581 ExpectJsFail("chrome.toolstrip.collapse(1)", |
582 "Uncaught Error: Invalid value for argument 0. " | 582 "Uncaught Error: Invalid value for argument 0. " |
583 "Expected 'object' but got 'integer'."); | 583 "Expected 'object' but got 'integer'."); |
584 ExpectJsFail("chrome.toolstrip.collapse(100)", | 584 ExpectJsFail("chrome.toolstrip.collapse(100)", |
585 "Uncaught Error: Invalid value for argument 0. " | 585 "Uncaught Error: Invalid value for argument 0. " |
586 "Expected 'object' but got 'integer'."); | 586 "Expected 'object' but got 'integer'."); |
587 ExpectJsFail("chrome.toolstrip.collapse({url:'http://foo/'}, 32)", | 587 ExpectJsFail("chrome.toolstrip.collapse({url:'http://foo/'}, 32)", |
588 "Uncaught Error: Invalid value for argument 1. " | 588 "Uncaught Error: Invalid value for argument 1. " |
589 "Expected 'function' but got 'integer'."); | 589 "Expected 'function' but got 'integer'."); |
590 } | 590 } |
| 591 |
| 592 // I18N API |
| 593 TEST_F(ExtensionAPIClientTest, GetAcceptLanguages) { |
| 594 ExpectJsFail("chrome.i18n.getAcceptLanguages(32, function(){})", |
| 595 "Uncaught Error: Too many arguments."); |
| 596 |
| 597 ExpectJsFail("chrome.i18n.getAcceptLanguages()", |
| 598 "Uncaught Error: Parameter 0 is required."); |
| 599 |
| 600 ExpectJsFail("chrome.i18n.getAcceptLanguages('abc')", |
| 601 "Uncaught Error: Invalid value for argument 0. " |
| 602 "Expected 'function' but got 'string'."); |
| 603 |
| 604 ExpectJsPass("chrome.i18n.getAcceptLanguages(function(){})", |
| 605 "i18n.getAcceptLanguages", "null"); |
| 606 } |
OLD | NEW |