| 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 // Contains holistic tests of the bindings infrastructure | 5 // Contains holistic tests of the bindings infrastructure |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/permissions/permissions_api.h" | 7 #include "chrome/browser/extensions/api/permissions/permissions_api.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/net/url_request_mock_util.h" | 9 #include "chrome/browser/net/url_request_mock_util.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, | 35 IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, |
| 36 UnavailableBindingsNeverRegistered) { | 36 UnavailableBindingsNeverRegistered) { |
| 37 // Test will request the 'storage' permission. | 37 // Test will request the 'storage' permission. |
| 38 PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); | 38 PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); |
| 39 ASSERT_TRUE(RunExtensionTest( | 39 ASSERT_TRUE(RunExtensionTest( |
| 40 "bindings/unavailable_bindings_never_registered")) << message_; | 40 "bindings/unavailable_bindings_never_registered")) << message_; |
| 41 } | 41 } |
| 42 | 42 |
| 43 #if defined(OS_LINUX) | |
| 44 // http://crbug.com/684358 | |
| 45 IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, | |
| 46 DISABLED_ExceptionInHandlerShouldNotCrash) { | |
| 47 #else | |
| 48 IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, | 43 IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, |
| 49 ExceptionInHandlerShouldNotCrash) { | 44 ExceptionInHandlerShouldNotCrash) { |
| 50 #endif | |
| 51 ASSERT_TRUE(RunExtensionSubtest( | 45 ASSERT_TRUE(RunExtensionSubtest( |
| 52 "bindings/exception_in_handler_should_not_crash", | 46 "bindings/exception_in_handler_should_not_crash", |
| 53 "page.html")) << message_; | 47 "page.html")) << message_; |
| 54 } | 48 } |
| 55 | 49 |
| 56 // Tests that an error raised during an async function still fires | 50 // Tests that an error raised during an async function still fires |
| 57 // the callback, but sets chrome.runtime.lastError. | 51 // the callback, but sets chrome.runtime.lastError. |
| 58 // FIXME should be in ExtensionBindingsApiTest. | 52 // FIXME should be in ExtensionBindingsApiTest. |
| 59 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, LastError) { | 53 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, LastError) { |
| 60 ASSERT_TRUE(LoadExtension( | 54 ASSERT_TRUE(LoadExtension( |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( | 265 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( |
| 272 ProcessManager::Get(profile()) | 266 ProcessManager::Get(profile()) |
| 273 ->GetBackgroundHostForExtension(receiver->id()) | 267 ->GetBackgroundHostForExtension(receiver->id()) |
| 274 ->host_contents(), | 268 ->host_contents(), |
| 275 "getMessageCountAfterReceivingRealSenderMessage()", &message_count)); | 269 "getMessageCountAfterReceivingRealSenderMessage()", &message_count)); |
| 276 EXPECT_EQ(1, message_count); | 270 EXPECT_EQ(1, message_count); |
| 277 } | 271 } |
| 278 | 272 |
| 279 } // namespace | 273 } // namespace |
| 280 } // namespace extensions | 274 } // namespace extensions |
| OLD | NEW |