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

Side by Side Diff: chrome/browser/notifications/desktop_notification_service_unittest.cc

Issue 63273002: Rename WebKit namespace to blink (part 4) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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) 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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 DesktopNotificationService* service_; 27 DesktopNotificationService* service_;
28 }; 28 };
29 29
30 TEST_F(DesktopNotificationServiceTest, SettingsForSchemes) { 30 TEST_F(DesktopNotificationServiceTest, SettingsForSchemes) {
31 GURL url("file:///html/test.html"); 31 GURL url("file:///html/test.html");
32 32
33 EXPECT_EQ(CONTENT_SETTING_ASK, 33 EXPECT_EQ(CONTENT_SETTING_ASK,
34 service_->GetDefaultContentSetting(NULL)); 34 service_->GetDefaultContentSetting(NULL));
35 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionNotAllowed, 35 EXPECT_EQ(blink::WebNotificationPresenter::PermissionNotAllowed,
36 service_->HasPermission(url)); 36 service_->HasPermission(url));
37 37
38 service_->GrantPermission(url); 38 service_->GrantPermission(url);
39 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionAllowed, 39 EXPECT_EQ(blink::WebNotificationPresenter::PermissionAllowed,
40 service_->HasPermission(url)); 40 service_->HasPermission(url));
41 41
42 service_->DenyPermission(url); 42 service_->DenyPermission(url);
43 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionDenied, 43 EXPECT_EQ(blink::WebNotificationPresenter::PermissionDenied,
44 service_->HasPermission(url)); 44 service_->HasPermission(url));
45 45
46 GURL https_url("https://testurl"); 46 GURL https_url("https://testurl");
47 GURL http_url("http://testurl"); 47 GURL http_url("http://testurl");
48 EXPECT_EQ(CONTENT_SETTING_ASK, 48 EXPECT_EQ(CONTENT_SETTING_ASK,
49 service_->GetDefaultContentSetting(NULL)); 49 service_->GetDefaultContentSetting(NULL));
50 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionNotAllowed, 50 EXPECT_EQ(blink::WebNotificationPresenter::PermissionNotAllowed,
51 service_->HasPermission(http_url)); 51 service_->HasPermission(http_url));
52 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionNotAllowed, 52 EXPECT_EQ(blink::WebNotificationPresenter::PermissionNotAllowed,
53 service_->HasPermission(https_url)); 53 service_->HasPermission(https_url));
54 54
55 service_->GrantPermission(https_url); 55 service_->GrantPermission(https_url);
56 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionNotAllowed, 56 EXPECT_EQ(blink::WebNotificationPresenter::PermissionNotAllowed,
57 service_->HasPermission(http_url)); 57 service_->HasPermission(http_url));
58 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionAllowed, 58 EXPECT_EQ(blink::WebNotificationPresenter::PermissionAllowed,
59 service_->HasPermission(https_url)); 59 service_->HasPermission(https_url));
60 60
61 service_->DenyPermission(http_url); 61 service_->DenyPermission(http_url);
62 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionDenied, 62 EXPECT_EQ(blink::WebNotificationPresenter::PermissionDenied,
63 service_->HasPermission(http_url)); 63 service_->HasPermission(http_url));
64 EXPECT_EQ(WebKit::WebNotificationPresenter::PermissionAllowed, 64 EXPECT_EQ(blink::WebNotificationPresenter::PermissionAllowed,
65 service_->HasPermission(https_url)); 65 service_->HasPermission(https_url));
66 } 66 }
67 67
68 TEST_F(DesktopNotificationServiceTest, GetNotificationsSettings) { 68 TEST_F(DesktopNotificationServiceTest, GetNotificationsSettings) {
69 service_->GrantPermission(GURL("http://allowed2.com")); 69 service_->GrantPermission(GURL("http://allowed2.com"));
70 service_->GrantPermission(GURL("http://allowed.com")); 70 service_->GrantPermission(GURL("http://allowed.com"));
71 service_->DenyPermission(GURL("http://denied2.com")); 71 service_->DenyPermission(GURL("http://denied2.com"));
72 service_->DenyPermission(GURL("http://denied.com")); 72 service_->DenyPermission(GURL("http://denied.com"));
73 73
74 ContentSettingsForOneType settings; 74 ContentSettingsForOneType settings;
(...skipping 19 matching lines...) Expand all
94 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard( 94 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(
95 GURL("http://denied2.com")), 95 GURL("http://denied2.com")),
96 settings[3].primary_pattern); 96 settings[3].primary_pattern);
97 EXPECT_EQ(CONTENT_SETTING_BLOCK, 97 EXPECT_EQ(CONTENT_SETTING_BLOCK,
98 settings[3].setting); 98 settings[3].setting);
99 EXPECT_EQ(ContentSettingsPattern::Wildcard(), 99 EXPECT_EQ(ContentSettingsPattern::Wildcard(),
100 settings[4].primary_pattern); 100 settings[4].primary_pattern);
101 EXPECT_EQ(CONTENT_SETTING_ASK, 101 EXPECT_EQ(CONTENT_SETTING_ASK,
102 settings[4].setting); 102 settings[4].setting);
103 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698