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

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

Issue 12208118: Add support for ordinal scroll amounts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix interactive_ui_tests failure Created 7 years, 10 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
« no previous file with comments | « no previous file | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/display/event_transformation_handler.h" 7 #include "ash/display/event_transformation_handler.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 aura::test::EventGenerator event_generator(root, window); 82 aura::test::EventGenerator event_generator(root, window);
83 int active_index = browser->tab_strip_model()->active_index(); 83 int active_index = browser->tab_strip_model()->active_index();
84 TabScrubber::Direction direction = index < active_index ? 84 TabScrubber::Direction direction = index < active_index ?
85 TabScrubber::LEFT : TabScrubber::RIGHT; 85 TabScrubber::LEFT : TabScrubber::RIGHT;
86 int offset = GetTabCenter(browser, index) - 86 int offset = GetTabCenter(browser, index) -
87 GetStartX(browser, active_index, direction); 87 GetStartX(browser, active_index, direction);
88 ui::ScrollEvent scroll_event(ui::ET_SCROLL, 88 ui::ScrollEvent scroll_event(ui::ET_SCROLL,
89 gfx::Point(0, 0), 89 gfx::Point(0, 0),
90 ui::EventTimeForNow(), 90 ui::EventTimeForNow(),
91 0, 91 0,
92 offset, 92 offset, 0,
93 0, 93 offset, 0,
94 3); 94 3);
95 event_generator.Dispatch(&scroll_event); 95 event_generator.Dispatch(&scroll_event);
96 } 96 }
97 97
98 enum ScrubType { 98 enum ScrubType {
99 EACH_TAB, 99 EACH_TAB,
100 SKIP_TABS, 100 SKIP_TABS,
101 REPEAT_TABS, 101 REPEAT_TABS,
102 }; 102 };
103 103
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 IN_PROC_BROWSER_TEST_F(TabScrubberTest, MoveAfter) { 399 IN_PROC_BROWSER_TEST_F(TabScrubberTest, MoveAfter) {
400 AddTabs(browser(), 2); 400 AddTabs(browser(), 2);
401 401
402 SendScrubEvent(browser(), 1); 402 SendScrubEvent(browser(), 1);
403 EXPECT_TRUE(TabScrubber::GetInstance()->IsActivationPending()); 403 EXPECT_TRUE(TabScrubber::GetInstance()->IsActivationPending());
404 browser()->tab_strip_model()->MoveSelectedTabsTo(0); 404 browser()->tab_strip_model()->MoveSelectedTabsTo(0);
405 EXPECT_EQ(2, TabScrubber::GetInstance()->highlighted_tab()); 405 EXPECT_EQ(2, TabScrubber::GetInstance()->highlighted_tab());
406 } 406 }
407 407
408 #endif // OS_CHROMEOS 408 #endif // OS_CHROMEOS
OLDNEW
« no previous file with comments | « no previous file | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698