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

Side by Side Diff: content/browser/renderer_host/input/touch_emulator_unittest.cc

Issue 345603003: aura: Allow specifying the size of TestScreen when creating it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 30 matching lines...) Expand all
41 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); 41 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
42 event_time_delta_seconds_ = 0.1; 42 event_time_delta_seconds_ = 0.1;
43 } 43 }
44 44
45 virtual ~TouchEmulatorTest() {} 45 virtual ~TouchEmulatorTest() {}
46 46
47 // testing::Test 47 // testing::Test
48 virtual void SetUp() OVERRIDE { 48 virtual void SetUp() OVERRIDE {
49 #if defined(USE_AURA) 49 #if defined(USE_AURA)
50 aura::Env::CreateInstance(true); 50 aura::Env::CreateInstance(true);
51 screen_.reset(aura::TestScreen::Create()); 51 screen_.reset(aura::TestScreen::Create(gfx::Size()));
52 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); 52 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
53 #endif 53 #endif
54 54
55 emulator_.reset(new TouchEmulator(this)); 55 emulator_.reset(new TouchEmulator(this));
56 emulator_->Enable(true /* allow_pinch */); 56 emulator_->Enable(true /* allow_pinch */);
57 } 57 }
58 58
59 virtual void TearDown() OVERRIDE { 59 virtual void TearDown() OVERRIDE {
60 emulator_->Disable(); 60 emulator_->Disable();
61 EXPECT_EQ("", ExpectedEvents()); 61 EXPECT_EQ("", ExpectedEvents());
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); 340 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents());
341 EXPECT_FALSE(SendMouseWheelEvent()); 341 EXPECT_FALSE(SendMouseWheelEvent());
342 emulator()->Disable(); 342 emulator()->Disable();
343 EXPECT_EQ("TouchCancel GestureTapCancel", ExpectedEvents()); 343 EXPECT_EQ("TouchCancel GestureTapCancel", ExpectedEvents());
344 EXPECT_TRUE(SendMouseWheelEvent()); 344 EXPECT_TRUE(SendMouseWheelEvent());
345 emulator()->Enable(true /* allow_pinch */); 345 emulator()->Enable(true /* allow_pinch */);
346 EXPECT_TRUE(SendMouseWheelEvent()); 346 EXPECT_TRUE(SendMouseWheelEvent());
347 } 347 }
348 348
349 } // namespace content 349 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698