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)); | |
29 MOCK_METHOD0(OnCancelled, void()); | 28 MOCK_METHOD0(OnCancelled, void()); |
30 MOCK_METHOD0(OnClosing, void()); | 29 MOCK_METHOD0(OnClosing, void()); |
31 }; | 30 }; |
32 | 31 |
33 } // namespace | 32 } // namespace |
34 | 33 |
35 class WebIntentPickerSheetControllerTest | 34 class WebIntentPickerSheetControllerTest |
36 : public TabContentsWrapperTestHarness { | 35 : public TabContentsWrapperTestHarness { |
37 public: | 36 public: |
38 WebIntentPickerSheetControllerTest() | 37 WebIntentPickerSheetControllerTest() |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 ASSERT_TRUE([[[item_view subviews] objectAtIndex:1] | 223 ASSERT_TRUE([[[item_view subviews] objectAtIndex:1] |
225 isKindOfClass:[NSButton class]]); | 224 isKindOfClass:[NSButton class]]); |
226 NSButton* title_button = [[item_view subviews] objectAtIndex:1]; | 225 NSButton* title_button = [[item_view subviews] objectAtIndex:1]; |
227 CheckButton(title_button, @selector(openExtensionLink:)); | 226 CheckButton(title_button, @selector(openExtensionLink:)); |
228 | 227 |
229 ASSERT_TRUE([[[item_view subviews] objectAtIndex:7] | 228 ASSERT_TRUE([[[item_view subviews] objectAtIndex:7] |
230 isKindOfClass:[NSButton class]]); | 229 isKindOfClass:[NSButton class]]); |
231 NSButton* add_button = [[item_view subviews] objectAtIndex:7]; | 230 NSButton* add_button = [[item_view subviews] objectAtIndex:7]; |
232 CheckButton(add_button, @selector(invokeService:)); | 231 CheckButton(add_button, @selector(invokeService:)); |
233 } | 232 } |
OLD | NEW |