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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 11339037: aura-touch: Refactor some code so that both cros and win-aura can share some code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "content/browser/renderer_host/render_widget_host_delegate.h" 9 #include "content/browser/renderer_host/render_widget_host_delegate.h"
10 #include "content/browser/renderer_host/render_widget_host_impl.h" 10 #include "content/browser/renderer_host/render_widget_host_impl.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 sibling->Show(); 140 sibling->Show();
141 window->parent()->AddChild(sibling.get()); 141 window->parent()->AddChild(sibling.get());
142 sibling->Focus(); 142 sibling->Focus();
143 ASSERT_TRUE(sibling->HasFocus()); 143 ASSERT_TRUE(sibling->HasFocus());
144 ASSERT_TRUE(observer.destroyed()); 144 ASSERT_TRUE(observer.destroyed());
145 145
146 widget_host_ = NULL; 146 widget_host_ = NULL;
147 view_ = NULL; 147 view_ = NULL;
148 } 148 }
149 149
150 #if !defined(OS_WIN) 150 // Checks that touch-event state is maintained correctly.
151 // Checks that touch-event state is maintained correctly. A lot of the
152 // touch-event related functions are not implemented on Windows. So run this
153 // test only in chromeos. http://crbug.com/157268
154 TEST_F(RenderWidgetHostViewAuraTest, TouchEventState) { 151 TEST_F(RenderWidgetHostViewAuraTest, TouchEventState) {
155 view_->InitAsChild(NULL); 152 view_->InitAsChild(NULL);
156 view_->Show(); 153 view_->Show();
157 154
158 // Start with no touch-event handler in the renderer. 155 // Start with no touch-event handler in the renderer.
159 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); 156 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false));
160 EXPECT_FALSE(widget_host_->ShouldForwardTouchEvent()); 157 EXPECT_FALSE(widget_host_->ShouldForwardTouchEvent());
161 158
162 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), 0, 159 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), 0,
163 base::Time::NowFromSystemTime() - base::Time()); 160 base::Time::NowFromSystemTime() - base::Time());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 EXPECT_EQ(ui::ER_UNHANDLED, view_->OnTouchEvent(&move)); 214 EXPECT_EQ(ui::ER_UNHANDLED, view_->OnTouchEvent(&move));
218 EXPECT_EQ(WebKit::WebInputEvent::TouchMove, view_->touch_event_.type); 215 EXPECT_EQ(WebKit::WebInputEvent::TouchMove, view_->touch_event_.type);
219 EXPECT_EQ(1U, view_->touch_event_.touchesLength); 216 EXPECT_EQ(1U, view_->touch_event_.touchesLength);
220 EXPECT_EQ(WebKit::WebTouchPoint::StateMoved, 217 EXPECT_EQ(WebKit::WebTouchPoint::StateMoved,
221 view_->touch_event_.touches[0].state); 218 view_->touch_event_.touches[0].state);
222 219
223 EXPECT_EQ(ui::ER_UNHANDLED, view_->OnTouchEvent(&release)); 220 EXPECT_EQ(ui::ER_UNHANDLED, view_->OnTouchEvent(&release));
224 EXPECT_EQ(WebKit::WebInputEvent::TouchEnd, view_->touch_event_.type); 221 EXPECT_EQ(WebKit::WebInputEvent::TouchEnd, view_->touch_event_.type);
225 EXPECT_EQ(0U, view_->touch_event_.touchesLength); 222 EXPECT_EQ(0U, view_->touch_event_.touchesLength);
226 } 223 }
227 #endif // !defined(OS_WIN)
228 224
229 } // namespace content 225 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/browser/renderer_host/ui_events_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698