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 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/prefs/pref_service.h" |
10 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/background/background_contents_service.h" | 12 #include "chrome/browser/background/background_contents_service.h" |
12 #include "chrome/browser/background/background_contents_service_factory.h" | 13 #include "chrome/browser/background/background_contents_service_factory.h" |
13 #include "chrome/browser/prefs/pref_service.h" | |
14 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 14 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
15 #include "chrome/browser/tab_contents/background_contents.h" | 15 #include "chrome/browser/tab_contents/background_contents.h" |
16 #include "chrome/browser/ui/browser_list.h" | 16 #include "chrome/browser/ui/browser_list.h" |
17 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
19 #include "chrome/test/base/testing_browser_process.h" | 19 #include "chrome/test/base/testing_browser_process.h" |
20 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
21 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
22 #include "googleurl/src/gurl.h" | 22 #include "googleurl/src/gurl.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 contents->Navigate(url); | 226 contents->Navigate(url); |
227 EXPECT_EQ(1U, GetPrefs(&profile)->size()); | 227 EXPECT_EQ(1U, GetPrefs(&profile)->size()); |
228 contents2->Navigate(url2); | 228 contents2->Navigate(url2); |
229 EXPECT_EQ(2U, GetPrefs(&profile)->size()); | 229 EXPECT_EQ(2U, GetPrefs(&profile)->size()); |
230 service.ShutdownAssociatedBackgroundContents(ASCIIToUTF16("appid")); | 230 service.ShutdownAssociatedBackgroundContents(ASCIIToUTF16("appid")); |
231 EXPECT_FALSE(service.IsTracked(contents)); | 231 EXPECT_FALSE(service.IsTracked(contents)); |
232 EXPECT_EQ(NULL, service.GetAppBackgroundContents(ASCIIToUTF16("appid"))); | 232 EXPECT_EQ(NULL, service.GetAppBackgroundContents(ASCIIToUTF16("appid"))); |
233 EXPECT_EQ(1U, GetPrefs(&profile)->size()); | 233 EXPECT_EQ(1U, GetPrefs(&profile)->size()); |
234 EXPECT_EQ(url2.spec(), GetPrefURLForApp(&profile, contents2->appid())); | 234 EXPECT_EQ(url2.spec(), GetPrefURLForApp(&profile, contents2->appid())); |
235 } | 235 } |
OLD | NEW |