OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/website_settings/permission_menu_model.h" | 5 #include "chrome/browser/ui/website_settings/permission_menu_model.h" |
6 #include "chrome/common/content_settings.h" | 6 #include "chrome/common/content_settings.h" |
7 #include "chrome/common/content_settings_types.h" | 7 #include "components/content_settings/core/common/content_settings_types.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 class TestCallback { | 13 class TestCallback { |
14 public: | 14 public: |
15 TestCallback() : current_(-1) {} | 15 TestCallback() : current_(-1) {} |
16 | 16 |
17 PermissionMenuModel::ChangeCallback callback() { | 17 PermissionMenuModel::ChangeCallback callback() { |
(...skipping 30 matching lines...) Expand all Loading... |
48 EXPECT_EQ(2, model.GetItemCount()); | 48 EXPECT_EQ(2, model.GetItemCount()); |
49 } | 49 } |
50 | 50 |
51 TEST(PermissionMenuModelTest, TestAllowBlock) { | 51 TEST(PermissionMenuModelTest, TestAllowBlock) { |
52 TestCallback callback; | 52 TestCallback callback; |
53 PermissionMenuModel model(GURL("http://www.google.com"), | 53 PermissionMenuModel model(GURL("http://www.google.com"), |
54 CONTENT_SETTING_ALLOW, | 54 CONTENT_SETTING_ALLOW, |
55 callback.callback()); | 55 callback.callback()); |
56 EXPECT_EQ(2, model.GetItemCount()); | 56 EXPECT_EQ(2, model.GetItemCount()); |
57 } | 57 } |
OLD | NEW |