| OLD | NEW |
| 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 #include "base/string16.h" | 5 #include "base/string16.h" |
| 6 #include "chrome/common/native_web_keyboard_event.h" | |
| 7 #include "chrome/common/render_messages.h" | 6 #include "chrome/common/render_messages.h" |
| 8 #include "chrome/test/render_view_test.h" | 7 #include "chrome/test/render_view_test.h" |
| 8 #include "content/common/native_web_keyboard_event.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 #include <Cocoa/Cocoa.h> | 11 #include <Cocoa/Cocoa.h> |
| 12 #include <Carbon/Carbon.h> // for the kVK_* constants. | 12 #include <Carbon/Carbon.h> // for the kVK_* constants. |
| 13 | 13 |
| 14 NSEvent* CmdDeadKeyEvent(NSEventType type, unsigned short code) { | 14 NSEvent* CmdDeadKeyEvent(NSEventType type, unsigned short code) { |
| 15 UniChar uniChar = 0; | 15 UniChar uniChar = 0; |
| 16 switch(code) { | 16 switch(code) { |
| 17 case kVK_UpArrow: | 17 case kVK_UpArrow: |
| 18 uniChar = NSUpArrowFunctionKey; | 18 uniChar = NSUpArrowFunctionKey; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 const char* kArrowUpNoScroll = | 130 const char* kArrowUpNoScroll = |
| 131 "38,false,false,true,false\np1\n\np2"; | 131 "38,false,false,true,false\np1\n\np2"; |
| 132 view_->OnSetEditCommandsForNextKeyEvent( | 132 view_->OnSetEditCommandsForNextKeyEvent( |
| 133 EditCommands(1, EditCommand("moveToBeginningOfDocument", ""))); | 133 EditCommands(1, EditCommand("moveToBeginningOfDocument", ""))); |
| 134 SendNativeKeyEvent(NativeWebKeyboardEvent(arrowUpKeyDown)); | 134 SendNativeKeyEvent(NativeWebKeyboardEvent(arrowUpKeyDown)); |
| 135 ProcessPendingMessages(); | 135 ProcessPendingMessages(); |
| 136 output = GetMainFrame()->contentAsText(kMaxOutputCharacters); | 136 output = GetMainFrame()->contentAsText(kMaxOutputCharacters); |
| 137 EXPECT_EQ(kArrowUpNoScroll, UTF16ToASCII(output)); | 137 EXPECT_EQ(kArrowUpNoScroll, UTF16ToASCII(output)); |
| 138 } | 138 } |
| 139 | 139 |
| OLD | NEW |