OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/desktop_notification_service.h" | 5 #include "chrome/browser/notifications/desktop_notification_service.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
11 #include "chrome/browser/notifications/notifications_prefs_cache.h" | 11 #include "chrome/browser/notifications/notifications_prefs_cache.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/prefs/scoped_pref_update.h" | 13 #include "chrome/browser/prefs/scoped_pref_update.h" |
14 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | |
15 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
16 #include "chrome/test/testing_profile.h" | 15 #include "chrome/test/testing_profile.h" |
| 16 #include "content/browser/renderer_host/test_render_view_host.h" |
17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 // NotificationsPrefsCache wants to be called on the IO thread. This class | 23 // NotificationsPrefsCache wants to be called on the IO thread. This class |
24 // routes calls to the cache on the IO thread. | 24 // routes calls to the cache on the IO thread. |
25 class ThreadProxy : public base::RefCountedThreadSafe<ThreadProxy> { | 25 class ThreadProxy : public base::RefCountedThreadSafe<ThreadProxy> { |
26 public: | 26 public: |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionDenied, | 240 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionDenied, |
241 proxy_->CacheHasPermission(cache_, denied_url)); | 241 proxy_->CacheHasPermission(cache_, denied_url)); |
242 | 242 |
243 service_->ResetBlockedOrigin(denied_url); | 243 service_->ResetBlockedOrigin(denied_url); |
244 | 244 |
245 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionNotAllowed, | 245 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionNotAllowed, |
246 proxy_->CacheHasPermission(cache_, denied_url)); | 246 proxy_->CacheHasPermission(cache_, denied_url)); |
247 } | 247 } |
248 | 248 |
249 } // namespace | 249 } // namespace |
OLD | NEW |