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

Unified Diff: chrome/browser/invalidation/invalidation_service_factory_browsertest.cc

Issue 327243003: Introduce ProfileInvalidationProvider wrapper for InvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix clang compilation. Created 6 years, 6 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/invalidation/invalidation_service_factory_browsertest.cc
diff --git a/chrome/browser/invalidation/invalidation_service_factory_browsertest.cc b/chrome/browser/invalidation/invalidation_service_factory_browsertest.cc
deleted file mode 100644
index e2370c12dcbab33a9f4220a701ed1f9c9e4df1de..0000000000000000000000000000000000000000
--- a/chrome/browser/invalidation/invalidation_service_factory_browsertest.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright 2014 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 "base/basictypes.h"
-#include "base/command_line.h"
-#include "base/compiler_specific.h"
-#include "chrome/browser/chromeos/login/users/user_manager.h"
-#include "chrome/browser/chromeos/profiles/profile_helper.h"
-#include "chrome/browser/invalidation/invalidation_service_factory.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/test/base/in_process_browser_test.h"
-#include "chromeos/chromeos_switches.h"
-#include "components/invalidation/invalidation_service.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace invalidation {
-
-class InvalidationServiceFactoryTestBase : public InProcessBrowserTest {
- protected:
- InvalidationServiceFactoryTestBase();
- virtual ~InvalidationServiceFactoryTestBase();
-
- InvalidationService* FindInvalidationServiceForProfile(Profile* profile);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(InvalidationServiceFactoryTestBase);
-};
-
-InvalidationServiceFactoryTestBase::InvalidationServiceFactoryTestBase() {
-}
-
-InvalidationServiceFactoryTestBase::~InvalidationServiceFactoryTestBase() {
-}
-
-InvalidationService*
-InvalidationServiceFactoryTestBase::FindInvalidationServiceForProfile(
- Profile* profile) {
- return static_cast<InvalidationService*>(
- InvalidationServiceFactory::GetInstance()->GetServiceForBrowserContext(
- profile, false));
-}
-
-class InvalidationServiceFactoryLoginScreenBrowserTest
- : public InvalidationServiceFactoryTestBase {
- protected:
- InvalidationServiceFactoryLoginScreenBrowserTest();
- virtual ~InvalidationServiceFactoryLoginScreenBrowserTest();
-
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(InvalidationServiceFactoryLoginScreenBrowserTest);
-};
-
-InvalidationServiceFactoryLoginScreenBrowserTest::
- InvalidationServiceFactoryLoginScreenBrowserTest() {
-}
-
-InvalidationServiceFactoryLoginScreenBrowserTest::
- ~InvalidationServiceFactoryLoginScreenBrowserTest() {
-}
-
-void InvalidationServiceFactoryLoginScreenBrowserTest::SetUpCommandLine(
- CommandLine* command_line) {
- command_line->AppendSwitch(chromeos::switches::kLoginManager);
- command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user");
-}
-
-// Verify that no InvalidationService is instantiated for the login profile on
-// the login screen.
-IN_PROC_BROWSER_TEST_F(InvalidationServiceFactoryLoginScreenBrowserTest,
- NoInvalidationService) {
- Profile* login_profile =
- chromeos::ProfileHelper::GetSigninProfile()->GetOriginalProfile();
- EXPECT_FALSE(FindInvalidationServiceForProfile(login_profile));
-}
-
-class InvalidationServiceFactoryGuestBrowserTest
- : public InvalidationServiceFactoryTestBase {
- protected:
- InvalidationServiceFactoryGuestBrowserTest();
- virtual ~InvalidationServiceFactoryGuestBrowserTest();
-
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(InvalidationServiceFactoryGuestBrowserTest);
-};
-
-InvalidationServiceFactoryGuestBrowserTest::
- InvalidationServiceFactoryGuestBrowserTest() {
-}
-
-InvalidationServiceFactoryGuestBrowserTest::
- ~InvalidationServiceFactoryGuestBrowserTest() {
-}
-
-void InvalidationServiceFactoryGuestBrowserTest::SetUpCommandLine(
- CommandLine* command_line) {
- command_line->AppendSwitch(chromeos::switches::kGuestSession);
- command_line->AppendSwitch(::switches::kIncognito);
- command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user");
- command_line->AppendSwitchASCII(chromeos::switches::kLoginUser,
- chromeos::UserManager::kGuestUserName);
-}
-
-// Verify that no InvalidationService is instantiated for the login profile or
-// the guest profile while a guest session is in progress.
-IN_PROC_BROWSER_TEST_F(InvalidationServiceFactoryGuestBrowserTest,
- NoInvalidationService) {
- chromeos::UserManager* user_manager = chromeos::UserManager::Get();
- EXPECT_TRUE(user_manager->IsLoggedInAsGuest());
- Profile* guest_profile = user_manager->GetProfileByUser(
- user_manager->GetActiveUser())->GetOriginalProfile();
- Profile* login_profile =
- chromeos::ProfileHelper::GetSigninProfile()->GetOriginalProfile();
- EXPECT_FALSE(FindInvalidationServiceForProfile(guest_profile));
- EXPECT_FALSE(FindInvalidationServiceForProfile(login_profile));
-}
-
-} // namespace invalidation

Powered by Google App Engine
This is Rietveld 408576698