OLD | NEW |
(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 |
OLD | NEW |