| OLD | NEW |
| 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/tabs/pinned_tab_codec.h" | 8 #include "chrome/browser/tabs/pinned_tab_codec.h" |
| 9 #include "chrome/browser/tabs/pinned_tab_service.h" | 9 #include "chrome/browser/tabs/pinned_tab_service.h" |
| 10 #include "chrome/browser/tabs/pinned_tab_service_factory.h" | 10 #include "chrome/browser/tabs/pinned_tab_service_factory.h" |
| 11 #include "chrome/browser/tabs/pinned_tab_test_utils.h" | 11 #include "chrome/browser/tabs/pinned_tab_test_utils.h" |
| 12 #include "chrome/browser/tabs/tab_strip_model.h" | 12 #include "chrome/browser/tabs/tab_strip_model.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/test/base/browser_with_test_window_test.h" | 14 #include "chrome/test/base/browser_with_test_window_test.h" |
| 15 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 ProfileKeyedBase* BuildPinnedTabService(Profile* profile) { | 20 ProfileKeyedService* BuildPinnedTabService(Profile* profile) { |
| 21 return new PinnedTabService(profile); | 21 return new PinnedTabService(profile); |
| 22 } | 22 } |
| 23 | 23 |
| 24 PinnedTabService* BuildForProfile(Profile* profile) { | 24 PinnedTabService* BuildForProfile(Profile* profile) { |
| 25 return static_cast<PinnedTabService*>( | 25 return static_cast<PinnedTabService*>( |
| 26 PinnedTabServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 26 PinnedTabServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 27 profile, BuildPinnedTabService)); | 27 profile, BuildPinnedTabService)); |
| 28 } | 28 } |
| 29 | 29 |
| 30 class PinnedTabServiceTest : public BrowserWithTestWindowTest { | 30 class PinnedTabServiceTest : public BrowserWithTestWindowTest { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 popup.reset(NULL); | 68 popup.reset(NULL); |
| 69 popup_window.reset(NULL); | 69 popup_window.reset(NULL); |
| 70 | 70 |
| 71 // Check the state to make sure it hasn't changed. | 71 // Check the state to make sure it hasn't changed. |
| 72 result = PinnedTabTestUtils::TabsToString( | 72 result = PinnedTabTestUtils::TabsToString( |
| 73 PinnedTabCodec::ReadPinnedTabs(profile())); | 73 PinnedTabCodec::ReadPinnedTabs(profile())); |
| 74 EXPECT_EQ("http://www.google.com/::pinned:", result); | 74 EXPECT_EQ("http://www.google.com/::pinned:", result); |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace | 77 } // namespace |
| OLD | NEW |