| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "chrome/browser/extensions/api/instance_id/instance_id_api.h" | 7 #include "chrome/browser/extensions/api/instance_id/instance_id_api.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/extensions/extension_gcm_app_handler.h" | 9 #include "chrome/browser/extensions/extension_gcm_app_handler.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void SetUpOnMainThread() override; | 41 void SetUpOnMainThread() override; |
| 42 void SetUpCommandLine(base::CommandLine* command_line) override; | 42 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 extensions::ScopedCurrentChannel current_channel_; | 45 extensions::ScopedCurrentChannel current_channel_; |
| 46 | 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(InstanceIDApiTest); | 47 DISALLOW_COPY_AND_ASSIGN(InstanceIDApiTest); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 InstanceIDApiTest::InstanceIDApiTest() | 50 InstanceIDApiTest::InstanceIDApiTest() |
| 51 : current_channel_(chrome::VersionInfo::CHANNEL_DEV) { | 51 : current_channel_(version_info::Channel::DEV) { |
| 52 } | 52 } |
| 53 | 53 |
| 54 void InstanceIDApiTest::SetUpOnMainThread() { | 54 void InstanceIDApiTest::SetUpOnMainThread() { |
| 55 gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactory( | 55 gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactory( |
| 56 browser()->profile(), &BuildFakeGCMProfileService); | 56 browser()->profile(), &BuildFakeGCMProfileService); |
| 57 | 57 |
| 58 ExtensionApiTest::SetUpOnMainThread(); | 58 ExtensionApiTest::SetUpOnMainThread(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void InstanceIDApiTest::SetUpCommandLine(base::CommandLine* command_line) { | 61 void InstanceIDApiTest::SetUpCommandLine(base::CommandLine* command_line) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 profile()->GetOffTheRecordProfile()); | 94 profile()->GetOffTheRecordProfile()); |
| 95 | 95 |
| 96 ASSERT_TRUE(RunExtensionTestIncognito("instance_id/incognito")); | 96 ASSERT_TRUE(RunExtensionTestIncognito("instance_id/incognito")); |
| 97 | 97 |
| 98 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 98 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 99 EXPECT_TRUE(incognito_catcher.GetNextResult()) << incognito_catcher.message(); | 99 EXPECT_TRUE(incognito_catcher.GetNextResult()) << incognito_catcher.message(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, BetaChannel) { | 102 IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, BetaChannel) { |
| 103 extensions::ScopedCurrentChannel current_channel_override( | 103 extensions::ScopedCurrentChannel current_channel_override( |
| 104 chrome::VersionInfo::CHANNEL_BETA); | 104 version_info::Channel::BETA); |
| 105 ASSERT_TRUE(RunExtensionTest("instance_id/channel")); | 105 ASSERT_TRUE(RunExtensionTest("instance_id/channel")); |
| 106 } | 106 } |
| 107 | 107 |
| 108 IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, StableChannel) { | 108 IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, StableChannel) { |
| 109 extensions::ScopedCurrentChannel current_channel_override( | 109 extensions::ScopedCurrentChannel current_channel_override( |
| 110 chrome::VersionInfo::CHANNEL_STABLE); | 110 version_info::Channel::STABLE); |
| 111 ASSERT_TRUE(RunExtensionTest("instance_id/channel")); | 111 ASSERT_TRUE(RunExtensionTest("instance_id/channel")); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace extensions | 114 } // namespace extensions |
| OLD | NEW |