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

Side by Side Diff: chrome/browser/ui/tabs/pinned_tab_service_unittest.cc

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_tabstrip.h" 9 #include "chrome/browser/ui/browser_tabstrip.h"
10 #include "chrome/browser/ui/tabs/pinned_tab_codec.h" 10 #include "chrome/browser/ui/tabs/pinned_tab_codec.h"
11 #include "chrome/browser/ui/tabs/pinned_tab_service.h" 11 #include "chrome/browser/ui/tabs/pinned_tab_service.h"
12 #include "chrome/browser/ui/tabs/pinned_tab_service_factory.h" 12 #include "chrome/browser/ui/tabs/pinned_tab_service_factory.h"
13 #include "chrome/browser/ui/tabs/pinned_tab_test_utils.h" 13 #include "chrome/browser/ui/tabs/pinned_tab_test_utils.h"
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" 14 #include "chrome/browser/ui/tabs/tab_strip_model.h"
15 #include "chrome/test/base/browser_with_test_window_test.h" 15 #include "chrome/test/base/browser_with_test_window_test.h"
16 #include "chrome/test/base/testing_profile.h" 16 #include "chrome/test/base/testing_profile.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 namespace { 19 namespace {
20 20
21 ProfileKeyedService* BuildPinnedTabService(content::BrowserContext* profile) { 21 BrowserContextKeyedService* BuildPinnedTabService(
22 content::BrowserContext* profile) {
22 return new PinnedTabService(static_cast<Profile*>(profile)); 23 return new PinnedTabService(static_cast<Profile*>(profile));
23 } 24 }
24 25
25 PinnedTabService* BuildForProfile(Profile* profile) { 26 PinnedTabService* BuildForProfile(Profile* profile) {
26 return static_cast<PinnedTabService*>( 27 return static_cast<PinnedTabService*>(
27 PinnedTabServiceFactory::GetInstance()->SetTestingFactoryAndUse( 28 PinnedTabServiceFactory::GetInstance()->SetTestingFactoryAndUse(
28 profile, BuildPinnedTabService)); 29 profile, BuildPinnedTabService));
29 } 30 }
30 31
31 class PinnedTabServiceTest : public BrowserWithTestWindowTest { 32 class PinnedTabServiceTest : public BrowserWithTestWindowTest {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 popup->tab_strip_model()->CloseAllTabs(); 70 popup->tab_strip_model()->CloseAllTabs();
70 popup.reset(NULL); 71 popup.reset(NULL);
71 72
72 // Check the state to make sure it hasn't changed. 73 // Check the state to make sure it hasn't changed.
73 result = PinnedTabTestUtils::TabsToString( 74 result = PinnedTabTestUtils::TabsToString(
74 PinnedTabCodec::ReadPinnedTabs(profile())); 75 PinnedTabCodec::ReadPinnedTabs(profile()));
75 EXPECT_EQ("http://www.google.com/::pinned:", result); 76 EXPECT_EQ("http://www.google.com/::pinned:", result);
76 } 77 }
77 78
78 } // namespace 79 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698