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 #include "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
6 #include "chrome/browser/extensions/browser_action_test_util.h" | 6 #include "chrome/browser/extensions/browser_action_test_util.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/test/base/ui_test_utils.h" | 9 #include "chrome/test/base/ui_test_utils.h" |
10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 ui_test_utils::WindowedNotificationObserver popup_observer( | 30 ui_test_utils::WindowedNotificationObserver popup_observer( |
31 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 31 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
32 content::NotificationService::AllSources()); | 32 content::NotificationService::AllSources()); |
33 GetBrowserActionsBar().Press(index); | 33 GetBrowserActionsBar().Press(index); |
34 popup_observer.Wait(); | 34 popup_observer.Wait(); |
35 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 35 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
36 return GetBrowserActionsBar().HasPopup(); | 36 return GetBrowserActionsBar().HasPopup(); |
37 } | 37 } |
38 }; | 38 }; |
39 | 39 |
40 #if defined(OS_WIN) // Not implemented on other platforms yet. | 40 #if defined(TOOLKIT_VIEWS) |
41 IN_PROC_BROWSER_TEST_F(KeybindingApiTest, Basic) { | 41 IN_PROC_BROWSER_TEST_F(KeybindingApiTest, Basic) { |
42 ASSERT_TRUE(test_server()->Start()); | 42 ASSERT_TRUE(test_server()->Start()); |
43 ASSERT_TRUE(RunExtensionTest("keybinding/basics")) << message_; | 43 ASSERT_TRUE(RunExtensionTest("keybinding/basics")) << message_; |
44 const Extension* extension = GetSingleLoadedExtension(); | 44 const Extension* extension = GetSingleLoadedExtension(); |
45 ASSERT_TRUE(extension) << message_; | 45 ASSERT_TRUE(extension) << message_; |
46 | 46 |
47 // Test that there is a browser action in the toolbar. | 47 // Test that there is a browser action in the toolbar. |
48 ASSERT_EQ(1, GetBrowserActionsBar().NumberOfBrowserActions()); | 48 ASSERT_EQ(1, GetBrowserActionsBar().NumberOfBrowserActions()); |
49 | 49 |
50 ui_test_utils::NavigateToURL(browser(), | 50 ui_test_utils::NavigateToURL(browser(), |
(...skipping 20 matching lines...) Expand all Loading... |
71 | 71 |
72 result = false; | 72 result = false; |
73 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 73 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
74 tab->GetRenderViewHost(), L"", | 74 tab->GetRenderViewHost(), L"", |
75 L"setInterval(function(){" | 75 L"setInterval(function(){" |
76 L" if(document.body.bgColor == 'blue'){" | 76 L" if(document.body.bgColor == 'blue'){" |
77 L" window.domAutomationController.send(true)}}, 100)", | 77 L" window.domAutomationController.send(true)}}, 100)", |
78 &result)); | 78 &result)); |
79 ASSERT_TRUE(result); | 79 ASSERT_TRUE(result); |
80 } | 80 } |
81 #endif // OS_WIN | 81 #endif // TOOLKIT_VIEWS |
OLD | NEW |