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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/api/notifications/notifications_api.h"
6 #include "chrome/browser/extensions/extension_function.h"
7 #include "chrome/browser/extensions/extension_function_test_utils.h"
8 #include "chrome/common/extensions/features/feature.h"
9 #include "chrome/test/base/browser_with_test_window_test.h"
10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 namespace utils = extension_function_test_utils;
14
15 namespace extensions {
16
17 class ExtensionNotificationsTest : public BrowserWithTestWindowTest {
18 };
19
20 TEST_F(ExtensionNotificationsTest, Channels) {
21 scoped_refptr<Extension> extension(utils::CreateEmptyExtensionWithLocation(
22 extensions::Manifest::UNPACKED));
23 scoped_refptr<NotificationsClearFunction> notification_function(
24 new extensions::NotificationsClearFunction());
25 notification_function->set_extension(extension.get());
26 {
27 Feature::ScopedCurrentChannel channel_scope(
28 chrome::VersionInfo::CHANNEL_CANARY);
29 ASSERT_TRUE(notification_function->IsNotificationsApiAvailable());
30 }
31 {
32 Feature::ScopedCurrentChannel channel_scope(
33 chrome::VersionInfo::CHANNEL_DEV);
34 ASSERT_TRUE(notification_function->IsNotificationsApiAvailable());
35 }
36 {
37 Feature::ScopedCurrentChannel channel_scope(
38 chrome::VersionInfo::CHANNEL_BETA);
39 ASSERT_FALSE(notification_function->IsNotificationsApiAvailable());
40 }
41 {
42 Feature::ScopedCurrentChannel channel_scope(
43 chrome::VersionInfo::CHANNEL_STABLE);
44 ASSERT_FALSE(notification_function->IsNotificationsApiAvailable());
45 }
46 }
47
48 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698