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

Side by Side Diff: views/view_unittest.cc

Issue 6480001: Migrate Event API methods to Google Style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <map> 5 #include <map>
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "ui/base/clipboard/clipboard.h" 9 #include "ui/base/clipboard/clipboard.h"
10 #include "ui/base/keycodes/keyboard_codes.h" 10 #include "ui/base/keycodes/keyboard_codes.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // Clean-up 319 // Clean-up
320 delete v1; 320 delete v1;
321 delete v2; // This also deletes v3 (child of v2). 321 delete v2; // This also deletes v3 (child of v2).
322 } 322 }
323 323
324 //////////////////////////////////////////////////////////////////////////////// 324 ////////////////////////////////////////////////////////////////////////////////
325 // MouseEvent 325 // MouseEvent
326 //////////////////////////////////////////////////////////////////////////////// 326 ////////////////////////////////////////////////////////////////////////////////
327 327
328 bool TestView::OnMousePressed(const MouseEvent& event) { 328 bool TestView::OnMousePressed(const MouseEvent& event) {
329 last_mouse_event_type_ = event.GetType(); 329 last_mouse_event_type_ = event.type();
330 location_.SetPoint(event.x(), event.y()); 330 location_.SetPoint(event.x(), event.y());
331 return true; 331 return true;
332 } 332 }
333 333
334 bool TestView::OnMouseDragged(const MouseEvent& event) { 334 bool TestView::OnMouseDragged(const MouseEvent& event) {
335 last_mouse_event_type_ = event.GetType(); 335 last_mouse_event_type_ = event.type();
336 location_.SetPoint(event.x(), event.y()); 336 location_.SetPoint(event.x(), event.y());
337 return true; 337 return true;
338 } 338 }
339 339
340 void TestView::OnMouseReleased(const MouseEvent& event, bool canceled) { 340 void TestView::OnMouseReleased(const MouseEvent& event, bool canceled) {
341 last_mouse_event_type_ = event.GetType(); 341 last_mouse_event_type_ = event.type();
342 location_.SetPoint(event.x(), event.y()); 342 location_.SetPoint(event.x(), event.y());
343 } 343 }
344 344
345 TEST_F(ViewTest, MouseEvent) { 345 TEST_F(ViewTest, MouseEvent) {
346 TestView* v1 = new TestView(); 346 TestView* v1 = new TestView();
347 v1->SetBounds(0, 0, 300, 300); 347 v1->SetBounds(0, 0, 300, 300);
348 348
349 TestView* v2 = new TestView(); 349 TestView* v2 = new TestView();
350 v2->SetBounds(100, 100, 100, 100); 350 v2->SetBounds(100, 100, 100, 100);
351 351
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 #endif 1507 #endif
1508 } 1508 }
1509 1509
1510 TEST_F(ViewTest, ChangeNativeViewHierarchyChangeHierarchy) { 1510 TEST_F(ViewTest, ChangeNativeViewHierarchyChangeHierarchy) {
1511 // TODO(georgey): Fix the test for Linux 1511 // TODO(georgey): Fix the test for Linux
1512 #if defined(OS_WIN) 1512 #if defined(OS_WIN)
1513 TestChangeNativeViewHierarchy test(this); 1513 TestChangeNativeViewHierarchy test(this);
1514 test.CheckChangingHierarhy(); 1514 test.CheckChangingHierarhy();
1515 #endif 1515 #endif
1516 } 1516 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698