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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 7 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
8 #import "chrome/browser/ui/cocoa/hover_close_button.h" | 8 #import "chrome/browser/ui/cocoa/hover_close_button.h" |
9 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" | 9 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" |
10 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 10 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
11 #import "chrome/browser/ui/cocoa/web_intent_sheet_controller.h" | 11 #import "chrome/browser/ui/cocoa/web_intent_sheet_controller.h" |
12 #include "chrome/browser/ui/cocoa/web_intent_picker_cocoa.h" | 12 #include "chrome/browser/ui/cocoa/web_intent_picker_cocoa.h" |
13 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" | 13 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" |
14 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" | 14 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" |
15 #include "content/browser/tab_contents/test_tab_contents.h" | 15 #include "content/browser/tab_contents/test_tab_contents.h" |
16 #include "content/test/test_browser_thread.h" | 16 #include "content/test/test_browser_thread.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 class MockIntentPickerDelegate : public WebIntentPickerDelegate { | 21 class MockIntentPickerDelegate : public WebIntentPickerDelegate { |
22 public: | 22 public: |
23 virtual ~MockIntentPickerDelegate() {} | 23 virtual ~MockIntentPickerDelegate() {} |
24 | 24 |
25 MOCK_METHOD2(OnServiceChosen, void(const GURL& url, Disposition disposition)); | 25 MOCK_METHOD2(OnServiceChosen, void(const GURL& url, Disposition disposition)); |
26 MOCK_METHOD1(OnInlineDispositionWebContentsCreated, | 26 MOCK_METHOD1(OnInlineDispositionWebContentsCreated, |
27 void(content::WebContents* web_contents)); | 27 void(content::WebContents* web_contents)); |
| 28 MOCK_METHOD1(OnExtensionInstallRequested, void(const std::string& id)); |
28 MOCK_METHOD0(OnCancelled, void()); | 29 MOCK_METHOD0(OnCancelled, void()); |
29 MOCK_METHOD0(OnClosing, void()); | 30 MOCK_METHOD0(OnClosing, void()); |
30 }; | 31 }; |
31 | 32 |
32 } // namespace | 33 } // namespace |
33 | 34 |
34 class WebIntentPickerSheetControllerTest | 35 class WebIntentPickerSheetControllerTest |
35 : public TabContentsWrapperTestHarness { | 36 : public TabContentsWrapperTestHarness { |
36 public: | 37 public: |
37 WebIntentPickerSheetControllerTest() | 38 WebIntentPickerSheetControllerTest() |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 ASSERT_TRUE([[[item_view subviews] objectAtIndex:1] | 224 ASSERT_TRUE([[[item_view subviews] objectAtIndex:1] |
224 isKindOfClass:[NSButton class]]); | 225 isKindOfClass:[NSButton class]]); |
225 NSButton* title_button = [[item_view subviews] objectAtIndex:1]; | 226 NSButton* title_button = [[item_view subviews] objectAtIndex:1]; |
226 CheckButton(title_button, @selector(openExtensionLink:)); | 227 CheckButton(title_button, @selector(openExtensionLink:)); |
227 | 228 |
228 ASSERT_TRUE([[[item_view subviews] objectAtIndex:7] | 229 ASSERT_TRUE([[[item_view subviews] objectAtIndex:7] |
229 isKindOfClass:[NSButton class]]); | 230 isKindOfClass:[NSButton class]]); |
230 NSButton* add_button = [[item_view subviews] objectAtIndex:7]; | 231 NSButton* add_button = [[item_view subviews] objectAtIndex:7]; |
231 CheckButton(add_button, @selector(invokeService:)); | 232 CheckButton(add_button, @selector(invokeService:)); |
232 } | 233 } |
OLD | NEW |