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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/ui/intents/web_intent_picker_model.h" | 6 #include "chrome/browser/ui/intents/web_intent_picker_model.h" |
7 #include "chrome/browser/ui/intents/web_intent_picker_model_observer.h" | 7 #include "chrome/browser/ui/intents/web_intent_picker_model_observer.h" |
8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/gfx/image/image.h" | 10 #include "ui/gfx/image/image.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 EXPECT_EQ(GURL::EmptyGURL(), model_.inline_disposition_url()); | 217 EXPECT_EQ(GURL::EmptyGURL(), model_.inline_disposition_url()); |
218 | 218 |
219 model_.AddInstalledService(kTitle1, kUrl1, kWindowDisposition); | 219 model_.AddInstalledService(kTitle1, kUrl1, kWindowDisposition); |
220 model_.AddInstalledService(kTitle2, kUrl2, kInlineDisposition); | 220 model_.AddInstalledService(kTitle2, kUrl2, kInlineDisposition); |
221 model_.SetInlineDisposition(kUrl2); | 221 model_.SetInlineDisposition(kUrl2); |
222 | 222 |
223 EXPECT_TRUE(model_.IsInlineDisposition()); | 223 EXPECT_TRUE(model_.IsInlineDisposition()); |
224 EXPECT_EQ(kUrl2, model_.inline_disposition_url()); | 224 EXPECT_EQ(kUrl2, model_.inline_disposition_url()); |
225 | 225 |
226 model_.Clear(); | 226 model_.Clear(); |
227 | |
228 EXPECT_FALSE(model_.IsInlineDisposition()); | 227 EXPECT_FALSE(model_.IsInlineDisposition()); |
229 EXPECT_EQ(GURL::EmptyGURL(), model_.inline_disposition_url()); | 228 EXPECT_EQ(GURL::EmptyGURL(), model_.inline_disposition_url()); |
230 } | 229 } |
| 230 |
| 231 |
| 232 TEST_F(WebIntentPickerModelTest, WaitingForSuggestions) { |
| 233 // Default status is that "waiting for suggestions". |
| 234 EXPECT_TRUE(model_.IsWaitingForSuggestions()); |
| 235 |
| 236 // "waiting" status can be toggled manually. |
| 237 EXPECT_CALL(observer_, OnModelChanged(&model_)).Times(2); |
| 238 model_.SetWaitingForSuggestions(false); |
| 239 EXPECT_FALSE(model_.IsWaitingForSuggestions()); |
| 240 model_.SetWaitingForSuggestions(true); |
| 241 EXPECT_TRUE(model_.IsWaitingForSuggestions()); |
| 242 } |
OLD | NEW |