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

Side by Side Diff: chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc

Issue 2564943002: Reland "Add thread checking to RunLoop, deprecate MessageLoopRunner. (patchset #4 id:20002 of https… (Closed)
Patch Set: Created 4 years 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 (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 "chrome/browser/ui/views/ash/tab_scrubber.h" 5 #include "chrome/browser/ui/views/ash/tab_scrubber.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "ash/display/event_transformation_handler.h" 9 #include "ash/display/event_transformation_handler.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (index == target_index_) 206 if (index == target_index_)
207 quit_closure_.Run(); 207 quit_closure_.Run();
208 } 208 }
209 209
210 // History of tab activation. Scrub() resets it. 210 // History of tab activation. Scrub() resets it.
211 std::vector<int> activation_order_; 211 std::vector<int> activation_order_;
212 212
213 private: 213 private:
214 void RunUntilTabActive(Browser* browser, int target) { 214 void RunUntilTabActive(Browser* browser, int target) {
215 base::RunLoop run_loop; 215 base::RunLoop run_loop;
216 quit_closure_ = content::GetQuitTaskForRunLoop(&run_loop); 216 quit_closure_ = content::GetDeferredQuitTaskForRunLoop(&run_loop);
217 browser->tab_strip_model()->AddObserver(this); 217 browser->tab_strip_model()->AddObserver(this);
218 target_index_ = target; 218 target_index_ = target;
219 content::RunThisRunLoop(&run_loop); 219 content::RunThisRunLoop(&run_loop);
220 browser->tab_strip_model()->RemoveObserver(this); 220 browser->tab_strip_model()->RemoveObserver(this);
221 target_index_ = -1; 221 target_index_ = -1;
222 } 222 }
223 223
224 base::Closure quit_closure_; 224 base::Closure quit_closure_;
225 int target_index_; 225 int target_index_;
226 226
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 468
469 SendScrubEvent(browser(), 1); 469 SendScrubEvent(browser(), 1);
470 EXPECT_TRUE(TabScrubber::GetInstance()->IsActivationPending()); 470 EXPECT_TRUE(TabScrubber::GetInstance()->IsActivationPending());
471 browser()->tab_strip_model()->ToggleSelectionAt(0); 471 browser()->tab_strip_model()->ToggleSelectionAt(0);
472 browser()->tab_strip_model()->ToggleSelectionAt(2); 472 browser()->tab_strip_model()->ToggleSelectionAt(2);
473 browser()->tab_strip_model()->MoveSelectedTabsTo(2); 473 browser()->tab_strip_model()->MoveSelectedTabsTo(2);
474 EXPECT_EQ(0, TabScrubber::GetInstance()->highlighted_tab()); 474 EXPECT_EQ(0, TabScrubber::GetInstance()->highlighted_tab());
475 } 475 }
476 476
477 #endif // defined(OS_CHROMEOS) 477 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/sync_file_system_service_unittest.cc ('k') | chrome/test/base/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698