OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/notifications/notification_permission_context.h" | 5 #include "chrome/browser/notifications/notification_permission_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/gtest_prod_util.h" | |
9 #include "chrome/browser/notifications/desktop_notification_profile_util.h" | 8 #include "chrome/browser/notifications/desktop_notification_profile_util.h" |
10 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
12 #include "components/content_settings/core/browser/host_content_settings_map.h" | 11 #include "components/content_settings/core/browser/host_content_settings_map.h" |
13 #include "content/public/test/test_browser_thread_bundle.h" | 12 #include "content/public/test/test_browser_thread_bundle.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "url/gurl.h" | 14 #include "url/gurl.h" |
16 | 15 |
17 // Web Notification permission requests will completely ignore the embedder | 16 // Web Notification permission requests will completely ignore the embedder |
18 // origin. See https://crbug.com/416894. | 17 // origin. See https://crbug.com/416894. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 53 |
55 NotificationPermissionContext context(&profile); | 54 NotificationPermissionContext context(&profile); |
56 EXPECT_EQ(CONTENT_SETTING_ASK, | 55 EXPECT_EQ(CONTENT_SETTING_ASK, |
57 context.GetPermissionStatus(origin, origin)); | 56 context.GetPermissionStatus(origin, origin)); |
58 | 57 |
59 context.UpdateContentSetting(origin, origin, CONTENT_SETTING_ALLOW); | 58 context.UpdateContentSetting(origin, origin, CONTENT_SETTING_ALLOW); |
60 | 59 |
61 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 60 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
62 context.GetPermissionStatus(origin, origin)); | 61 context.GetPermissionStatus(origin, origin)); |
63 } | 62 } |
OLD | NEW |