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

Side by Side Diff: chrome/test/render_view_test.h

Issue 92122: Implements keyboard events for RenderViewTest.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « chrome/renderer/render_view_unittest.cc ('k') | chrome/test/render_view_test.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef CHROME_TEST_RENDER_VIEW_TEST_H_ 5 #ifndef CHROME_TEST_RENDER_VIEW_TEST_H_
6 #define CHROME_TEST_RENDER_VIEW_TEST_H_ 6 #define CHROME_TEST_RENDER_VIEW_TEST_H_
7 7
8 #include <string>
9
8 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
11 #include "chrome/renderer/mock_keyboard.h"
9 #include "chrome/renderer/mock_render_process.h" 12 #include "chrome/renderer/mock_render_process.h"
10 #include "chrome/renderer/mock_render_thread.h" 13 #include "chrome/renderer/mock_render_thread.h"
11 #include "chrome/renderer/render_view.h" 14 #include "chrome/renderer/render_view.h"
12 #include "chrome/renderer/renderer_webkitclient_impl.h" 15 #include "chrome/renderer/renderer_webkitclient_impl.h"
13 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
14 #include "webkit/glue/webframe.h" 17 #include "webkit/glue/webframe.h"
15 18
16 class RenderViewTest : public testing::Test { 19 class RenderViewTest : public testing::Test {
17 public: 20 public:
18 RenderViewTest() {} 21 RenderViewTest() {}
19 ~RenderViewTest() {} 22 ~RenderViewTest() {}
20 23
21 protected: 24 protected:
22 // Spins the message loop to process all messages that are currently pending. 25 // Spins the message loop to process all messages that are currently pending.
23 void ProcessPendingMessages(); 26 void ProcessPendingMessages();
24 27
25 // Returns a pointer to the main frame. 28 // Returns a pointer to the main frame.
26 WebFrame* GetMainFrame(); 29 WebFrame* GetMainFrame();
27 30
28 // Executes the given JavaScript in the context of the main frame. The input 31 // Executes the given JavaScript in the context of the main frame. The input
29 // is a NULL-terminated UTF-8 string. 32 // is a NULL-terminated UTF-8 string.
30 void ExecuteJavaScript(const char* js); 33 void ExecuteJavaScript(const char* js);
31 34
32 // Loads the given HTML into the main frame as a data: URL. 35 // Loads the given HTML into the main frame as a data: URL.
33 void LoadHTML(const char* html); 36 void LoadHTML(const char* html);
34 37
38 // Sends IPC messages that emulates a key-press event.
39 int SendKeyEvent(MockKeyboard::Layout layout,
40 int key_code,
41 MockKeyboard::Modifiers key_modifiers,
42 std::wstring* output);
43
35 // testing::Test 44 // testing::Test
36 virtual void SetUp(); 45 virtual void SetUp();
37 46
38 virtual void TearDown(); 47 virtual void TearDown();
39 48
40 MessageLoop msg_loop_; 49 MessageLoop msg_loop_;
41 MockRenderThread render_thread_; 50 MockRenderThread render_thread_;
42 scoped_ptr<MockProcess> mock_process_; 51 scoped_ptr<MockProcess> mock_process_;
43 scoped_refptr<RenderView> view_; 52 scoped_refptr<RenderView> view_;
44 RendererWebKitClientImpl webkitclient_; 53 RendererWebKitClientImpl webkitclient_;
54 scoped_ptr<MockKeyboard> mock_keyboard_;
45 }; 55 };
46 56
47 #endif // CHROME_TEST_RENDER_VIEW_TEST_H_ 57 #endif // CHROME_TEST_RENDER_VIEW_TEST_H_
OLDNEW
« no previous file with comments | « chrome/renderer/render_view_unittest.cc ('k') | chrome/test/render_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698