| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/background/background_mode_manager.h" | 8 #include "chrome/browser/background/background_mode_manager.h" |
| 9 #include "chrome/browser/profiles/profile_info_cache.h" | 9 #include "chrome/browser/profiles/profile_info_cache.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 manager.OnProfileNameChanged(p1name, UTF8ToUTF16("p1new")); | 270 manager.OnProfileNameChanged(p1name, UTF8ToUTF16("p1new")); |
| 271 | 271 |
| 272 EXPECT_EQ(UTF8ToUTF16("p1new"), | 272 EXPECT_EQ(UTF8ToUTF16("p1new"), |
| 273 manager.GetBackgroundModeData(profile1)->name()); | 273 manager.GetBackgroundModeData(profile1)->name()); |
| 274 | 274 |
| 275 TestingProfile* profile2 = profile_manager_.CreateTestingProfile("p2"); | 275 TestingProfile* profile2 = profile_manager_.CreateTestingProfile("p2"); |
| 276 manager.RegisterProfile(profile2); | 276 manager.RegisterProfile(profile2); |
| 277 EXPECT_EQ(2, manager.NumberOfBackgroundModeData()); | 277 EXPECT_EQ(2, manager.NumberOfBackgroundModeData()); |
| 278 | 278 |
| 279 gfx::Image gaia_image(gfx::test::CreateImage()); | 279 gfx::Image gaia_image(gfx::test::CreateImage()); |
| 280 manager.OnProfileAdded(UTF8ToUTF16("p2new"), | 280 manager.OnProfileAdded(profile2->GetPath(), |
| 281 profile2->GetPath().BaseName().LossyDisplayName(), | 281 profile2->GetPath().BaseName().LossyDisplayName()); |
| 282 profile2->GetPath(), | |
| 283 &gaia_image); | |
| 284 EXPECT_EQ(UTF8ToUTF16("p2new"), | 282 EXPECT_EQ(UTF8ToUTF16("p2new"), |
| 285 manager.GetBackgroundModeData(profile2)->name()); | 283 manager.GetBackgroundModeData(profile2)->name()); |
| 286 | 284 |
| 287 manager.OnProfileWillBeRemoved(UTF8ToUTF16("p2new")); | 285 manager.OnProfileWillBeRemoved(UTF8ToUTF16("p2new")); |
| 288 EXPECT_EQ(1, manager.NumberOfBackgroundModeData()); | 286 EXPECT_EQ(1, manager.NumberOfBackgroundModeData()); |
| 289 | 287 |
| 290 // Check that the background mode data we think is in the map actually is. | 288 // Check that the background mode data we think is in the map actually is. |
| 291 EXPECT_EQ(UTF8ToUTF16("p1new"), | 289 EXPECT_EQ(UTF8ToUTF16("p1new"), |
| 292 manager.GetBackgroundModeData(profile1)->name()); | 290 manager.GetBackgroundModeData(profile1)->name()); |
| 293 } | 291 } |
| OLD | NEW |