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

Side by Side Diff: chrome/browser/profiles/profile_manager_unittest.cc

Issue 10779042: Move notifications only used in chrome/ to chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix oops Created 8 years, 5 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 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 scoped_ptr<Browser> browser2(new Browser(Browser::TYPE_TABBED, profile2)); 477 scoped_ptr<Browser> browser2(new Browser(Browser::TYPE_TABBED, profile2));
478 478
479 std::vector<Profile*> last_opened_profiles = 479 std::vector<Profile*> last_opened_profiles =
480 profile_manager->GetLastOpenedProfiles(); 480 profile_manager->GetLastOpenedProfiles();
481 ASSERT_EQ(2U, last_opened_profiles.size()); 481 ASSERT_EQ(2U, last_opened_profiles.size());
482 EXPECT_EQ(profile1, last_opened_profiles[0]); 482 EXPECT_EQ(profile1, last_opened_profiles[0]);
483 EXPECT_EQ(profile2, last_opened_profiles[1]); 483 EXPECT_EQ(profile2, last_opened_profiles[1]);
484 484
485 // Simulate a shutdown. 485 // Simulate a shutdown.
486 content::NotificationService::current()->Notify( 486 content::NotificationService::current()->Notify(
487 content::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, 487 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST,
488 content::NotificationService::AllSources(), 488 content::NotificationService::AllSources(),
489 content::NotificationService::NoDetails()); 489 content::NotificationService::NoDetails());
490 490
491 // Even if the browsers are destructed during shutdown, the profiles stay 491 // Even if the browsers are destructed during shutdown, the profiles stay
492 // open. 492 // open.
493 browser1.reset(); 493 browser1.reset();
494 browser2.reset(); 494 browser2.reset();
495 495
496 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); 496 last_opened_profiles = profile_manager->GetLastOpenedProfiles();
497 ASSERT_EQ(2U, last_opened_profiles.size()); 497 ASSERT_EQ(2U, last_opened_profiles.size());
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 browser2b.reset(); 552 browser2b.reset();
553 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); 553 last_opened_profiles = profile_manager->GetLastOpenedProfiles();
554 ASSERT_EQ(1U, last_opened_profiles.size()); 554 ASSERT_EQ(1U, last_opened_profiles.size());
555 EXPECT_EQ(profile1, last_opened_profiles[0]); 555 EXPECT_EQ(profile1, last_opened_profiles[0]);
556 556
557 browser1.reset(); 557 browser1.reset();
558 last_opened_profiles = profile_manager->GetLastOpenedProfiles(); 558 last_opened_profiles = profile_manager->GetLastOpenedProfiles();
559 ASSERT_EQ(0U, last_opened_profiles.size()); 559 ASSERT_EQ(0U, last_opened_profiles.size());
560 } 560 }
561 #endif // !defined(OS_ANDROID) 561 #endif // !defined(OS_ANDROID)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698