| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 "Uncaught Error: Parameter 0 is required."); | 134 "Uncaught Error: Parameter 0 is required."); |
| 135 | 135 |
| 136 ExpectJsFail("chrome.windows.getCurrent('abc');", | 136 ExpectJsFail("chrome.windows.getCurrent('abc');", |
| 137 "Uncaught Error: Invalid value for argument 0. " | 137 "Uncaught Error: Invalid value for argument 0. " |
| 138 "Expected 'function' but got 'string'."); | 138 "Expected 'function' but got 'string'."); |
| 139 | 139 |
| 140 ExpectJsPass("chrome.windows.getCurrent(function(){})", | 140 ExpectJsPass("chrome.windows.getCurrent(function(){})", |
| 141 "windows.getCurrent", "null"); | 141 "windows.getCurrent", "null"); |
| 142 } | 142 } |
| 143 | 143 |
| 144 TEST_F(ExtensionAPIClientTest, GetLastFocusedWindow) { | 144 // http://crbug.com/22248 |
| 145 TEST_F(ExtensionAPIClientTest, DISABLED_GetLastFocusedWindow) { |
| 145 ExpectJsFail("chrome.windows.getLastFocused(function(){}, 20);", | 146 ExpectJsFail("chrome.windows.getLastFocused(function(){}, 20);", |
| 146 "Uncaught Error: Too many arguments."); | 147 "Uncaught Error: Too many arguments."); |
| 147 | 148 |
| 148 ExpectJsFail("chrome.windows.getLastFocused();", | 149 ExpectJsFail("chrome.windows.getLastFocused();", |
| 149 "Uncaught Error: Parameter 0 is required."); | 150 "Uncaught Error: Parameter 0 is required."); |
| 150 | 151 |
| 151 ExpectJsFail("chrome.windows.getLastFocused('abc');", | 152 ExpectJsFail("chrome.windows.getLastFocused('abc');", |
| 152 "Uncaught Error: Invalid value for argument 0. " | 153 "Uncaught Error: Invalid value for argument 0. " |
| 153 "Expected 'function' but got 'string'."); | 154 "Expected 'function' but got 'string'."); |
| 154 | 155 |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 ExpectJsFail("chrome.i18n.getAcceptLanguages()", | 598 ExpectJsFail("chrome.i18n.getAcceptLanguages()", |
| 598 "Uncaught Error: Parameter 0 is required."); | 599 "Uncaught Error: Parameter 0 is required."); |
| 599 | 600 |
| 600 ExpectJsFail("chrome.i18n.getAcceptLanguages('abc')", | 601 ExpectJsFail("chrome.i18n.getAcceptLanguages('abc')", |
| 601 "Uncaught Error: Invalid value for argument 0. " | 602 "Uncaught Error: Invalid value for argument 0. " |
| 602 "Expected 'function' but got 'string'."); | 603 "Expected 'function' but got 'string'."); |
| 603 | 604 |
| 604 ExpectJsPass("chrome.i18n.getAcceptLanguages(function(){})", | 605 ExpectJsPass("chrome.i18n.getAcceptLanguages(function(){})", |
| 605 "i18n.getAcceptLanguages", "null"); | 606 "i18n.getAcceptLanguages", "null"); |
| 606 } | 607 } |
| OLD | NEW |