OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
11 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 11 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
14 #include "content/test/test_browser_thread.h" | 14 #include "content/public/test/test_browser_thread.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" |
17 | 17 |
18 using content::BrowserThread; | 18 using content::BrowserThread; |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // The HasPermission method of the DesktopNotificationService wants to be called | 22 // The HasPermission method of the DesktopNotificationService wants to be called |
23 // on the IO thread. This class routes calls to the cache on the IO thread. | 23 // on the IO thread. This class routes calls to the cache on the IO thread. |
24 class ThreadProxy : public base::RefCountedThreadSafe<ThreadProxy> { | 24 class ThreadProxy : public base::RefCountedThreadSafe<ThreadProxy> { |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard( | 187 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard( |
188 GURL("http://denied2.com")), | 188 GURL("http://denied2.com")), |
189 settings[3].primary_pattern); | 189 settings[3].primary_pattern); |
190 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 190 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
191 settings[3].setting); | 191 settings[3].setting); |
192 EXPECT_EQ(ContentSettingsPattern::Wildcard(), | 192 EXPECT_EQ(ContentSettingsPattern::Wildcard(), |
193 settings[4].primary_pattern); | 193 settings[4].primary_pattern); |
194 EXPECT_EQ(CONTENT_SETTING_ASK, | 194 EXPECT_EQ(CONTENT_SETTING_ASK, |
195 settings[4].setting); | 195 settings[4].setting); |
196 } | 196 } |
OLD | NEW |