Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chrome/renderer/extensions/extension_api_client_unittest.cc

Issue 174116: chrome.i18n API (accept languages part 1) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/i18n.html ('k') | chrome/test/data/extensions/api_test/i18n/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698