OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 5 |
6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/background_contents_service.h" | 10 #include "chrome/browser/background_contents_service.h" |
11 #include "chrome/browser/browser_list.h" | 11 #include "chrome/browser/browser_list.h" |
12 #include "chrome/browser/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/tab_contents/background_contents.h" | 13 #include "chrome/browser/tab_contents/background_contents.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "chrome/test/testing_browser_process.h" | 16 #include "chrome/test/testing_browser_process.h" |
17 #include "chrome/test/testing_profile.h" | 17 #include "chrome/test/testing_profile.h" |
18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "testing/platform_test.h" | 20 #include "testing/platform_test.h" |
21 | 21 |
22 class BackgroundContentsServiceTest : public testing::Test { | 22 class BackgroundContentsServiceTest : public testing::Test { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 contents->Navigate(url); | 223 contents->Navigate(url); |
224 EXPECT_EQ(1U, GetPrefs(&profile)->size()); | 224 EXPECT_EQ(1U, GetPrefs(&profile)->size()); |
225 contents2->Navigate(url2); | 225 contents2->Navigate(url2); |
226 EXPECT_EQ(2U, GetPrefs(&profile)->size()); | 226 EXPECT_EQ(2U, GetPrefs(&profile)->size()); |
227 service.ShutdownAssociatedBackgroundContents(ASCIIToUTF16("appid")); | 227 service.ShutdownAssociatedBackgroundContents(ASCIIToUTF16("appid")); |
228 EXPECT_FALSE(service.IsTracked(contents)); | 228 EXPECT_FALSE(service.IsTracked(contents)); |
229 EXPECT_EQ(NULL, service.GetAppBackgroundContents(ASCIIToUTF16("appid"))); | 229 EXPECT_EQ(NULL, service.GetAppBackgroundContents(ASCIIToUTF16("appid"))); |
230 EXPECT_EQ(1U, GetPrefs(&profile)->size()); | 230 EXPECT_EQ(1U, GetPrefs(&profile)->size()); |
231 EXPECT_EQ(url2.spec(), GetPrefURLForApp(&profile, contents2->appid())); | 231 EXPECT_EQ(url2.spec(), GetPrefURLForApp(&profile, contents2->appid())); |
232 } | 232 } |
OLD | NEW |