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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 void TearDown() override { 793 void TearDown() override {
794 ChromeLauncherControllerTest::TearDown(); 794 ChromeLauncherControllerTest::TearDown();
795 user_manager_enabler_.reset(); 795 user_manager_enabler_.reset();
796 for (ProfileToNameMap::iterator it = created_profiles_.begin(); 796 for (ProfileToNameMap::iterator it = created_profiles_.begin();
797 it != created_profiles_.end(); ++it) 797 it != created_profiles_.end(); ++it)
798 profile_manager_->DeleteTestingProfile(it->second); 798 profile_manager_->DeleteTestingProfile(it->second);
799 chromeos::WallpaperManager::Shutdown(); 799 chromeos::WallpaperManager::Shutdown();
800 800
801 // A Task is leaked if we don't destroy everything, then run the message 801 // A Task is leaked if we don't destroy everything, then run the message
802 // loop. 802 // loop.
803 base::MessageLoop::current()->PostTask(FROM_HERE, 803 base::MessageLoop::current()->PostTask(
804 base::MessageLoop::QuitClosure()); 804 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
805 base::MessageLoop::current()->Run(); 805 base::MessageLoop::current()->Run();
806 } 806 }
807 807
808 // Creates a profile for a given |user_name|. Note that this class will keep 808 // Creates a profile for a given |user_name|. Note that this class will keep
809 // the ownership of the created object. 809 // the ownership of the created object.
810 TestingProfile* CreateMultiUserProfile(const std::string& user_name) { 810 TestingProfile* CreateMultiUserProfile(const std::string& user_name) {
811 std::string email_string = user_name + "@example.com"; 811 std::string email_string = user_name + "@example.com";
812 static_cast<ash::test::TestSessionStateDelegate*>( 812 static_cast<ash::test::TestSessionStateDelegate*>(
813 ash::Shell::GetInstance()->session_state_delegate()) 813 ash::Shell::GetInstance()->session_state_delegate())
814 ->AddUser(email_string); 814 ->AddUser(email_string);
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 2673
2674 EXPECT_EQ(1, app_icon_loader->fetch_count()); 2674 EXPECT_EQ(1, app_icon_loader->fetch_count());
2675 ASSERT_EQ(initial_size + 1, model_->items().size()); 2675 ASSERT_EQ(initial_size + 1, model_->items().size());
2676 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); 2676 EXPECT_TRUE(launcher_controller_->IsAppPinned("1"));
2677 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); 2677 EXPECT_FALSE(launcher_controller_->IsAppPinned("0"));
2678 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); 2678 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type);
2679 2679
2680 launcher_controller_->UnpinAppWithID("1"); 2680 launcher_controller_->UnpinAppWithID("1");
2681 ASSERT_EQ(initial_size, model_->items().size()); 2681 ASSERT_EQ(initial_size, model_->items().size());
2682 } 2682 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698