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

Unified Diff: chrome/browser/extensions/api/instance_id/instance_id_apitest.cc

Issue 1131793011: Remove the extra guard in InstanceIDProfileService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | chrome/browser/services/gcm/instance_id/instance_id_profile_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/instance_id/instance_id_apitest.cc
diff --git a/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc b/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc
index 54f07576a06913f992760e07b60f3e276b025406..7fd63a0a912e4d01780b501dfb40db3fc9fa459f 100644
--- a/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc
+++ b/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc
@@ -32,15 +32,21 @@ KeyedService* BuildFakeGCMProfileService(content::BrowserContext* context) {
class InstanceIDApiTest : public ExtensionApiTest {
public:
- InstanceIDApiTest() {}
+ InstanceIDApiTest();
protected:
void SetUpOnMainThread() override;
private:
+ extensions::ScopedCurrentChannel current_channel_;
+
DISALLOW_COPY_AND_ASSIGN(InstanceIDApiTest);
};
+InstanceIDApiTest::InstanceIDApiTest()
+ : current_channel_(chrome::VersionInfo::CHANNEL_DEV) {
+}
+
void InstanceIDApiTest::SetUpOnMainThread() {
gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactory(
browser()->profile(), &BuildFakeGCMProfileService);
@@ -49,39 +55,26 @@ void InstanceIDApiTest::SetUpOnMainThread() {
}
IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, GetID) {
- extensions::ScopedCurrentChannel current_channel(
- chrome::VersionInfo::CHANNEL_DEV);
ASSERT_TRUE(RunExtensionTest("instance_id/get_id"));
}
IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, GetCreationTime) {
- extensions::ScopedCurrentChannel current_channel(
- chrome::VersionInfo::CHANNEL_DEV);
ASSERT_TRUE(RunExtensionTest("instance_id/get_creation_time"));
}
IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, DeleteID) {
- extensions::ScopedCurrentChannel current_channel(
- chrome::VersionInfo::CHANNEL_DEV);
ASSERT_TRUE(RunExtensionTest("instance_id/delete_id"));
}
IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, GetToken) {
- extensions::ScopedCurrentChannel current_channel(
- chrome::VersionInfo::CHANNEL_DEV);
ASSERT_TRUE(RunExtensionTest("instance_id/get_token"));
}
IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, DeleteToken) {
- extensions::ScopedCurrentChannel current_channel(
- chrome::VersionInfo::CHANNEL_DEV);
ASSERT_TRUE(RunExtensionTest("instance_id/delete_token"));
}
IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, Incognito) {
- extensions::ScopedCurrentChannel current_channel(
- chrome::VersionInfo::CHANNEL_DEV);
-
ResultCatcher catcher;
catcher.RestrictToBrowserContext(profile());
ResultCatcher incognito_catcher;
@@ -95,13 +88,13 @@ IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, Incognito) {
}
IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, BetaChannel) {
- extensions::ScopedCurrentChannel current_channel(
+ extensions::ScopedCurrentChannel current_channel_override(
chrome::VersionInfo::CHANNEL_BETA);
ASSERT_TRUE(RunExtensionTest("instance_id/channel"));
}
IN_PROC_BROWSER_TEST_F(InstanceIDApiTest, StableChannel) {
- extensions::ScopedCurrentChannel current_channel(
+ extensions::ScopedCurrentChannel current_channel_override(
chrome::VersionInfo::CHANNEL_STABLE);
ASSERT_TRUE(RunExtensionTest("instance_id/channel"));
}
« no previous file with comments | « no previous file | chrome/browser/services/gcm/instance_id/instance_id_profile_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698