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

Unified Diff: chrome/browser/notifications/notifications_prefs_cache_unittest.cc

Issue 7655019: Migrate Obsolete NotificationsSettings and remove content_settings::NotificationsProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove include of deleted notifications_prefs_cache.h Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/notifications/notifications_prefs_cache.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/notifications_prefs_cache_unittest.cc
diff --git a/chrome/browser/notifications/notifications_prefs_cache_unittest.cc b/chrome/browser/notifications/notifications_prefs_cache_unittest.cc
deleted file mode 100644
index 2b27abae15ddc6895aa8e5751360ca8ed36a7b16..0000000000000000000000000000000000000000
--- a/chrome/browser/notifications/notifications_prefs_cache_unittest.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/notifications/notifications_prefs_cache.h"
-
-#include "base/message_loop.h"
-#include "content/browser/browser_thread.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresenter.h"
-
-TEST(NotificationsPrefsCacheTest, CanCreate) {
- scoped_refptr<NotificationsPrefsCache> cache(new NotificationsPrefsCache());
- std::vector<GURL> allowed_origins;
- allowed_origins.push_back(GURL("http://allowed.com"));
- std::vector<GURL> denied_origins;
- denied_origins.push_back(GURL("http://denied.com"));
-
- {
- MessageLoop loop;
- BrowserThread ui_thread(BrowserThread::UI, &loop);
-
- cache->SetCacheAllowedOrigins(allowed_origins);
- cache->SetCacheDeniedOrigins(denied_origins);
- cache->SetCacheDefaultContentSetting(CONTENT_SETTING_DEFAULT);
- }
-
- cache->set_is_initialized(true);
-
- {
- MessageLoop loop;
- BrowserThread io_thread(BrowserThread::IO, &loop);
-
- cache->CacheAllowedOrigin(GURL("http://allowed2.com"));
- cache->CacheDeniedOrigin(GURL("http://denied2.com"));
-
- EXPECT_EQ(cache->HasPermission(GURL("http://allowed.com")),
- WebKit::WebNotificationPresenter::PermissionAllowed);
- EXPECT_EQ(cache->HasPermission(GURL("http://allowed2.com")),
- WebKit::WebNotificationPresenter::PermissionAllowed);
-
- EXPECT_EQ(cache->HasPermission(GURL("http://denied.com")),
- WebKit::WebNotificationPresenter::PermissionDenied);
- EXPECT_EQ(cache->HasPermission(GURL("http://denied2.com")),
- WebKit::WebNotificationPresenter::PermissionDenied);
-
- EXPECT_EQ(cache->HasPermission(GURL("http://unkown.com")),
- WebKit::WebNotificationPresenter::PermissionNotAllowed);
-
- cache->SetCacheDefaultContentSetting(CONTENT_SETTING_ASK);
- EXPECT_EQ(cache->HasPermission(GURL("http://unkown.com")),
- WebKit::WebNotificationPresenter::PermissionNotAllowed);
-
- cache->SetCacheDefaultContentSetting(CONTENT_SETTING_ALLOW);
- EXPECT_EQ(cache->HasPermission(GURL("http://unkown.com")),
- WebKit::WebNotificationPresenter::PermissionAllowed);
-
- cache->SetCacheDefaultContentSetting(CONTENT_SETTING_BLOCK);
- EXPECT_EQ(cache->HasPermission(GURL("http://unkown.com")),
- WebKit::WebNotificationPresenter::PermissionDenied);
- }
-}
-
« no previous file with comments | « chrome/browser/notifications/notifications_prefs_cache.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698