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

Side by Side Diff: chrome/browser/ui/intents/web_intent_picker_model_unittest.cc

Issue 10855066: intents: Remove the disposition enum in web intents model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head 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
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/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"
11 #include "ui/gfx/image/image_unittest_util.h" 11 #include "ui/gfx/image/image_unittest_util.h"
12 12
13 namespace { 13 namespace {
14 14
15 const string16 kTitle1(ASCIIToUTF16("Foo")); 15 const string16 kTitle1(ASCIIToUTF16("Foo"));
16 const string16 kTitle2(ASCIIToUTF16("Bar")); 16 const string16 kTitle2(ASCIIToUTF16("Bar"));
17 const string16 kTitle3(ASCIIToUTF16("Baz")); 17 const string16 kTitle3(ASCIIToUTF16("Baz"));
18 const string16 kTitle4(ASCIIToUTF16("Biff")); 18 const string16 kTitle4(ASCIIToUTF16("Biff"));
19 const string16 kTitle5(ASCIIToUTF16("Max")); 19 const string16 kTitle5(ASCIIToUTF16("Max"));
20 const string16 kTitle6(ASCIIToUTF16("Lulz")); 20 const string16 kTitle6(ASCIIToUTF16("Lulz"));
21 const GURL kUrl1("http://www.example.com/foo"); 21 const GURL kUrl1("http://www.example.com/foo");
22 const GURL kUrl2("http://www.example.com/bar"); 22 const GURL kUrl2("http://www.example.com/bar");
23 const GURL kUrl3("http://www.example.com/baz"); 23 const GURL kUrl3("http://www.example.com/baz");
24 const string16 kId1(ASCIIToUTF16("nhkckhebbbncbkefhcpcgepcgfaclehe")); 24 const string16 kId1(ASCIIToUTF16("nhkckhebbbncbkefhcpcgepcgfaclehe"));
25 const string16 kId2(ASCIIToUTF16("hcpcgepcgfaclehenhkckhebbbncbkef")); 25 const string16 kId2(ASCIIToUTF16("hcpcgepcgfaclehenhkckhebbbncbkef"));
26 const string16 kId3(ASCIIToUTF16("aclehenhkckhebbbncbkefhcpcgepcgf")); 26 const string16 kId3(ASCIIToUTF16("aclehenhkckhebbbncbkefhcpcgepcgf"));
27 const string16 kId4(ASCIIToUTF16("bclehenhkckhebbbncbkefhcpcgepcgf")); 27 const string16 kId4(ASCIIToUTF16("bclehenhkckhebbbncbkefhcpcgepcgf"));
28 const string16 kId5(ASCIIToUTF16("cclehenhkckhebbbncbkefhcpcgepcgf")); 28 const string16 kId5(ASCIIToUTF16("cclehenhkckhebbbncbkefhcpcgepcgf"));
29 const string16 kId6(ASCIIToUTF16("dclehenhkckhebbbncbkefhcpcgepcgf")); 29 const string16 kId6(ASCIIToUTF16("dclehenhkckhebbbncbkefhcpcgepcgf"));
30 const WebIntentPickerModel::Disposition kWindowDisposition( 30 const webkit_glue::WebIntentServiceData::Disposition kWindowDisposition(
31 WebIntentPickerModel::DISPOSITION_WINDOW); 31 webkit_glue::WebIntentServiceData::DISPOSITION_WINDOW);
32 const WebIntentPickerModel::Disposition kInlineDisposition( 32 const webkit_glue::WebIntentServiceData::Disposition kInlineDisposition(
33 WebIntentPickerModel::DISPOSITION_INLINE); 33 webkit_glue::WebIntentServiceData::DISPOSITION_INLINE);
34 34
35 } 35 }
36 36
37 class WebIntentPickerModelObserverMock : public WebIntentPickerModelObserver { 37 class WebIntentPickerModelObserverMock : public WebIntentPickerModelObserver {
38 public: 38 public:
39 MOCK_METHOD1(OnModelChanged, void(WebIntentPickerModel* model)); 39 MOCK_METHOD1(OnModelChanged, void(WebIntentPickerModel* model));
40 MOCK_METHOD2(OnFaviconChanged, 40 MOCK_METHOD2(OnFaviconChanged,
41 void(WebIntentPickerModel* model, size_t index)); 41 void(WebIntentPickerModel* model, size_t index));
42 MOCK_METHOD2(OnExtensionIconChanged, 42 MOCK_METHOD2(OnExtensionIconChanged,
43 void(WebIntentPickerModel* model, const string16& extension_id)); 43 void(WebIntentPickerModel* model, const string16& extension_id));
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 227
228 EXPECT_FALSE(model_.IsInlineDisposition()); 228 EXPECT_FALSE(model_.IsInlineDisposition());
229 EXPECT_EQ(GURL::EmptyGURL(), model_.inline_disposition_url()); 229 EXPECT_EQ(GURL::EmptyGURL(), model_.inline_disposition_url());
230 } 230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698