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" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/favicon/favicon_service.h" | 12 #include "chrome/browser/favicon/favicon_service.h" |
13 #include "chrome/browser/intents/web_intents_registry.h" | 13 #include "chrome/browser/intents/web_intents_registry.h" |
14 #include "chrome/browser/intents/web_intents_registry_factory.h" | 14 #include "chrome/browser/intents/web_intents_registry_factory.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/intents/web_intent_picker.h" | 17 #include "chrome/browser/ui/intents/web_intent_picker.h" |
18 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 18 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
19 #include "chrome/browser/ui/intents/web_intent_picker_factory.h" | 19 #include "chrome/browser/ui/intents/web_intent_picker_factory.h" |
20 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" | 20 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" |
21 #include "chrome/browser/webdata/web_data_service.h" | 21 #include "chrome/browser/webdata/web_data_service.h" |
22 #include "chrome/test/base/testing_profile.h" | 22 #include "chrome/test/base/testing_profile.h" |
23 #include "content/browser/tab_contents/tab_contents.h" | 23 #include "content/browser/tab_contents/tab_contents.h" |
24 #include "content/browser/tab_contents/test_tab_contents.h" | 24 #include "content/browser/tab_contents/test_tab_contents.h" |
25 #include "content/test/test_browser_thread.h" | 25 #include "content/test/test_browser_thread.h" |
26 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
27 #include "ui/gfx/codec/png_codec.h" | 27 #include "ui/gfx/codec/png_codec.h" |
28 #include "webkit/glue/web_intent_service_data.h" | 28 #include "webkit/glue/web_intent_service_data.h" |
29 | 29 |
| 30 using content::BrowserThread; |
30 using testing::_; | 31 using testing::_; |
31 using testing::AtMost; | 32 using testing::AtMost; |
32 using testing::DoAll; | 33 using testing::DoAll; |
33 using testing::Invoke; | 34 using testing::Invoke; |
34 using testing::Return; | 35 using testing::Return; |
35 using testing::SaveArg; | 36 using testing::SaveArg; |
36 | 37 |
37 namespace { | 38 namespace { |
38 | 39 |
39 const string16 kAction1(ASCIIToUTF16("http://www.example.com/share")); | 40 const string16 kAction1(ASCIIToUTF16("http://www.example.com/share")); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 .Times(0); | 253 .Times(0); |
253 EXPECT_CALL(*controller_, OnCancelled()) | 254 EXPECT_CALL(*controller_, OnCancelled()) |
254 .WillOnce(Invoke(controller_.get(), | 255 .WillOnce(Invoke(controller_.get(), |
255 &TestWebIntentPickerController::BaseOnCancelled)); | 256 &TestWebIntentPickerController::BaseOnCancelled)); |
256 EXPECT_CALL(*picker_factory_, ClosePicker(_)); | 257 EXPECT_CALL(*picker_factory_, ClosePicker(_)); |
257 | 258 |
258 controller_->ShowDialog(NULL, kAction1, kType); | 259 controller_->ShowDialog(NULL, kAction1, kType); |
259 WaitForDialogToShow(); | 260 WaitForDialogToShow(); |
260 delegate_->OnCancelled(); | 261 delegate_->OnCancelled(); |
261 } | 262 } |
OLD | NEW |