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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/favicon/favicon_service.h" | 9 #include "chrome/browser/favicon/favicon_service.h" |
10 #include "chrome/browser/intents/web_intents_registry.h" | 10 #include "chrome/browser/intents/web_intents_registry.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 // |controller_| takes ownership. | 106 // |controller_| takes ownership. |
107 WebIntentPickerFactoryMock* picker_factory_; | 107 WebIntentPickerFactoryMock* picker_factory_; |
108 | 108 |
109 scoped_ptr<WebIntentPickerController> controller_; | 109 scoped_ptr<WebIntentPickerController> controller_; |
110 WebIntentPickerDelegate* delegate_; | 110 WebIntentPickerDelegate* delegate_; |
111 WebDataService* web_data_service_; | 111 WebDataService* web_data_service_; |
112 FaviconService* favicon_service_; | 112 FaviconService* favicon_service_; |
113 }; | 113 }; |
114 | 114 |
115 IN_PROC_BROWSER_TEST_F(WebIntentPickerControllerBrowserTest, ChooseService) { | 115 // http://crbug.com/104140 |
| 116 IN_PROC_BROWSER_TEST_F(WebIntentPickerControllerBrowserTest, |
| 117 FLAKY_ChooseService) { |
116 web_data_service_ = | 118 web_data_service_ = |
117 browser()->profile()->GetWebDataService(Profile::EXPLICIT_ACCESS); | 119 browser()->profile()->GetWebDataService(Profile::EXPLICIT_ACCESS); |
118 AddWebIntentService(kAction1, kServiceURL1); | 120 AddWebIntentService(kAction1, kServiceURL1); |
119 AddWebIntentService(kAction1, kServiceURL2); | 121 AddWebIntentService(kAction1, kServiceURL2); |
120 | 122 |
121 favicon_service_ = | 123 favicon_service_ = |
122 browser()->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); | 124 browser()->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); |
123 | 125 |
124 picker_factory_ = new WebIntentPickerFactoryMock(); | 126 picker_factory_ = new WebIntentPickerFactoryMock(); |
125 controller_.reset(new WebIntentPickerController( | 127 controller_.reset(new WebIntentPickerController( |
126 browser()->GetSelectedTabContentsWrapper(), picker_factory_)); | 128 browser()->GetSelectedTabContentsWrapper(), picker_factory_)); |
127 | 129 |
128 SetPickerExpectations(2, 2); | 130 SetPickerExpectations(2, 2); |
129 | 131 |
130 controller_->ShowDialog(NULL, kAction1, kType); | 132 controller_->ShowDialog(NULL, kAction1, kType); |
131 WaitForDialogToShow(); | 133 WaitForDialogToShow(); |
132 | 134 |
133 delegate_->OnServiceChosen(1); | 135 delegate_->OnServiceChosen(1); |
134 ASSERT_EQ(2, browser()->tab_count()); | 136 ASSERT_EQ(2, browser()->tab_count()); |
135 EXPECT_EQ(GURL(kServiceURL2), | 137 EXPECT_EQ(GURL(kServiceURL2), |
136 browser()->GetSelectedTabContents()->GetURL()); | 138 browser()->GetSelectedTabContents()->GetURL()); |
137 } | 139 } |
OLD | NEW |