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

Unified Diff: chrome/browser/extensions/api/notifications/notifications_api_unittest.cc

Issue 12313115: Take notification API out of experimental. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict. Created 7 years, 9 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
Index: chrome/browser/extensions/api/notifications/notifications_api_unittest.cc
diff --git a/chrome/browser/extensions/api/notifications/notifications_api_unittest.cc b/chrome/browser/extensions/api/notifications/notifications_api_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b1c32acf3e386a151bb069e9ca86bd7d02ff1257
--- /dev/null
+++ b/chrome/browser/extensions/api/notifications/notifications_api_unittest.cc
@@ -0,0 +1,48 @@
+// Copyright (c) 2013 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/extensions/api/notifications/notifications_api.h"
+#include "chrome/browser/extensions/extension_function.h"
+#include "chrome/browser/extensions/extension_function_test_utils.h"
+#include "chrome/common/extensions/features/feature.h"
+#include "chrome/test/base/browser_with_test_window_test.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace utils = extension_function_test_utils;
+
+namespace extensions {
+
+class ExtensionNotificationsTest : public BrowserWithTestWindowTest {
+};
+
+TEST_F(ExtensionNotificationsTest, Channels) {
+ scoped_refptr<Extension> extension(utils::CreateEmptyExtensionWithLocation(
+ extensions::Manifest::UNPACKED));
+ scoped_refptr<NotificationsClearFunction> notification_function(
+ new extensions::NotificationsClearFunction());
+ notification_function->set_extension(extension.get());
+ {
+ Feature::ScopedCurrentChannel channel_scope(
+ chrome::VersionInfo::CHANNEL_CANARY);
+ ASSERT_TRUE(notification_function->IsNotificationsApiAvailable());
+ }
+ {
+ Feature::ScopedCurrentChannel channel_scope(
+ chrome::VersionInfo::CHANNEL_DEV);
+ ASSERT_TRUE(notification_function->IsNotificationsApiAvailable());
+ }
+ {
+ Feature::ScopedCurrentChannel channel_scope(
+ chrome::VersionInfo::CHANNEL_BETA);
+ ASSERT_FALSE(notification_function->IsNotificationsApiAvailable());
+ }
+ {
+ Feature::ScopedCurrentChannel channel_scope(
+ chrome::VersionInfo::CHANNEL_STABLE);
+ ASSERT_FALSE(notification_function->IsNotificationsApiAvailable());
+ }
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698