Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Side by Side Diff: chrome/browser/ui/cocoa/web_intent_sheet_controller_browsertest.mm

Issue 10855066: intents: Remove the disposition enum in web intents model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mock type. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/web_intent_sheet_controller_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "chrome/test/base/in_process_browser_test.h" 6 #include "chrome/test/base/in_process_browser_test.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_tabstrip.h" 8 #include "chrome/browser/ui/browser_tabstrip.h"
9 #include "chrome/browser/ui/cocoa/web_intent_picker_cocoa.h" 9 #include "chrome/browser/ui/cocoa/web_intent_picker_cocoa.h"
10 #import "chrome/browser/ui/cocoa/web_intent_sheet_controller.h" 10 #import "chrome/browser/ui/cocoa/web_intent_sheet_controller.h"
11 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" 11 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h"
12 #include "chrome/browser/ui/intents/web_intent_picker_model.h" 12 #include "chrome/browser/ui/intents/web_intent_picker_model.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 #include "webkit/glue/web_intent_service_data.h"
14 15
15 class MockIntentPickerDelegate : public WebIntentPickerDelegate { 16 class MockIntentPickerDelegate : public WebIntentPickerDelegate {
16 public: 17 public:
17 MockIntentPickerDelegate() {} 18 MockIntentPickerDelegate() {}
18 virtual ~MockIntentPickerDelegate() {} 19 virtual ~MockIntentPickerDelegate() {}
19 20
20 MOCK_METHOD2(OnServiceChosen, void(const GURL& url, Disposition disposition)); 21 MOCK_METHOD2(OnServiceChosen, void(
22 const GURL& url,
23 webkit_glue::WebIntentServiceData::Disposition disposition));
21 MOCK_METHOD1(OnInlineDispositionWebContentsCreated, 24 MOCK_METHOD1(OnInlineDispositionWebContentsCreated,
22 void(content::WebContents* web_contents)); 25 void(content::WebContents* web_contents));
23 MOCK_METHOD1(OnExtensionInstallRequested, void(const std::string& id)); 26 MOCK_METHOD1(OnExtensionInstallRequested, void(const std::string& id));
24 MOCK_METHOD1(OnExtensionLinkClicked, void(const std::string& id)); 27 MOCK_METHOD1(OnExtensionLinkClicked, void(const std::string& id));
25 MOCK_METHOD0(OnSuggestionsLinkClicked, void ()); 28 MOCK_METHOD0(OnSuggestionsLinkClicked, void ());
26 MOCK_METHOD0(OnPickerClosed, void()); 29 MOCK_METHOD0(OnPickerClosed, void());
27 MOCK_METHOD0(OnChooseAnotherService, void()); 30 MOCK_METHOD0(OnChooseAnotherService, void());
28 MOCK_METHOD0(OnClosing, void()); 31 MOCK_METHOD0(OnClosing, void());
29 }; 32 };
30 33
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 70
68 ignore_result(picker_.release()); // Closing |picker_| will destruct it. 71 ignore_result(picker_.release()); // Closing |picker_| will destruct it.
69 } 72 }
70 73
71 IN_PROC_BROWSER_TEST_F(WebIntentSheetControllerBrowserTest, 74 IN_PROC_BROWSER_TEST_F(WebIntentSheetControllerBrowserTest,
72 DontCancelAfterServiceInvokation) { 75 DontCancelAfterServiceInvokation) {
73 CreateBubble(chrome::GetActiveTabContents(browser())); 76 CreateBubble(chrome::GetActiveTabContents(browser()));
74 77
75 GURL url; 78 GURL url;
76 model_.AddInstalledService(string16(), url, 79 model_.AddInstalledService(string16(), url,
77 WebIntentPickerModel::DISPOSITION_WINDOW); 80 webkit_glue::WebIntentServiceData::DISPOSITION_WINDOW);
78 81
79 EXPECT_CALL(delegate_, OnServiceChosen( 82 EXPECT_CALL(delegate_, OnServiceChosen(
80 url, WebIntentPickerModel::DISPOSITION_WINDOW)); 83 url, webkit_glue::WebIntentServiceData::DISPOSITION_WINDOW));
81 EXPECT_CALL(delegate_, OnPickerClosed()).Times(0); 84 EXPECT_CALL(delegate_, OnPickerClosed()).Times(0);
82 EXPECT_CALL(delegate_, OnClosing()); 85 EXPECT_CALL(delegate_, OnClosing());
83 86
84 picker_->OnServiceChosen(0); 87 picker_->OnServiceChosen(0);
85 picker_->Close(); 88 picker_->Close();
86 89
87 ignore_result(picker_.release()); // Closing |picker_| will destruct it. 90 ignore_result(picker_.release()); // Closing |picker_| will destruct it.
88 } 91 }
89 92
90 IN_PROC_BROWSER_TEST_F(WebIntentSheetControllerBrowserTest, 93 IN_PROC_BROWSER_TEST_F(WebIntentSheetControllerBrowserTest,
91 OnCancelledWillSignalClose) { 94 OnCancelledWillSignalClose) {
92 CreatePicker(); 95 CreatePicker();
93 EXPECT_CALL(delegate_, OnPickerClosed()); 96 EXPECT_CALL(delegate_, OnPickerClosed());
94 EXPECT_CALL(delegate_, OnClosing()); 97 EXPECT_CALL(delegate_, OnClosing());
95 picker_->OnCancelled(); 98 picker_->OnCancelled();
96 99
97 ignore_result(picker_.release()); // Closing |picker_| will destruct it. 100 ignore_result(picker_.release()); // Closing |picker_| will destruct it.
98 } 101 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/web_intent_sheet_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698