OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 WebIntentPickerControllerTest() | 117 WebIntentPickerControllerTest() |
118 : ui_thread_(BrowserThread::UI, &message_loop_), | 118 : ui_thread_(BrowserThread::UI, &message_loop_), |
119 db_thread_(BrowserThread::DB, &message_loop_), | 119 db_thread_(BrowserThread::DB, &message_loop_), |
120 picker_factory_(NULL), | 120 picker_factory_(NULL), |
121 delegate_(NULL) { | 121 delegate_(NULL) { |
122 } | 122 } |
123 | 123 |
124 virtual void SetUp() { | 124 virtual void SetUp() { |
125 TabContentsWrapperTestHarness::SetUp(); | 125 TabContentsWrapperTestHarness::SetUp(); |
126 | 126 |
127 profile_->CreateFaviconService(); | 127 profile()->CreateFaviconService(); |
128 profile_->CreateWebDataService(true); | 128 profile()->CreateWebDataService(true); |
129 web_data_service_ = profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); | 129 web_data_service_ = profile()->GetWebDataService(Profile::EXPLICIT_ACCESS); |
130 favicon_service_ = profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); | 130 favicon_service_ = profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); |
131 WebIntentsRegistry *registry = | 131 WebIntentsRegistry *registry = |
132 WebIntentsRegistryFactory::GetForProfile(profile_.get()); | 132 WebIntentsRegistryFactory::GetForProfile(profile()); |
133 registry->Initialize(web_data_service_); | 133 registry->Initialize(web_data_service_); |
134 | 134 |
135 picker_factory_ = new WebIntentPickerFactoryMock(); | 135 picker_factory_ = new WebIntentPickerFactoryMock(); |
136 controller_.reset(new TestWebIntentPickerController(contents_wrapper(), | 136 controller_.reset(new TestWebIntentPickerController(contents_wrapper(), |
137 picker_factory_)); | 137 picker_factory_)); |
138 } | 138 } |
139 | 139 |
140 virtual void TearDown() { | 140 virtual void TearDown() { |
141 controller_.reset(); | 141 controller_.reset(); |
142 | 142 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 .Times(0); | 264 .Times(0); |
265 EXPECT_CALL(*controller_, OnCancelled()) | 265 EXPECT_CALL(*controller_, OnCancelled()) |
266 .WillOnce(Invoke(controller_.get(), | 266 .WillOnce(Invoke(controller_.get(), |
267 &TestWebIntentPickerController::BaseOnCancelled)); | 267 &TestWebIntentPickerController::BaseOnCancelled)); |
268 EXPECT_CALL(*picker_factory_, ClosePicker(_)); | 268 EXPECT_CALL(*picker_factory_, ClosePicker(_)); |
269 | 269 |
270 controller_->ShowDialog(kAction1, kType); | 270 controller_->ShowDialog(kAction1, kType); |
271 WaitForDialogToShow(); | 271 WaitForDialogToShow(); |
272 delegate_->OnCancelled(); | 272 delegate_->OnCancelled(); |
273 } | 273 } |
OLD | NEW |