OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 webView->settings()->setPluginsEnabled(true); | 192 webView->settings()->setPluginsEnabled(true); |
193 webView->resize(WebSize(300, 300)); | 193 webView->resize(WebSize(300, 300)); |
194 webView->layout(); | 194 webView->layout(); |
195 FrameTestHelpers::runPendingTasks(); | 195 FrameTestHelpers::runPendingTasks(); |
196 | 196 |
197 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE
lementById(WebString::fromUTF8("translated-plugin")); | 197 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE
lementById(WebString::fromUTF8("translated-plugin")); |
198 PlatformEvent::Modifiers modifierKey = PlatformEvent::CtrlKey; | 198 PlatformEvent::Modifiers modifierKey = PlatformEvent::CtrlKey; |
199 #if OS(MACOSX) | 199 #if OS(MACOSX) |
200 modifierKey = PlatformEvent::MetaKey; | 200 modifierKey = PlatformEvent::MetaKey; |
201 #endif | 201 #endif |
202 PlatformKeyboardEvent platformKeyboardEventC(PlatformEvent::RawKeyDown, "",
"", "67", 67, 0, false, false, false, modifierKey, 0.0); | 202 PlatformKeyboardEvent platformKeyboardEventC(PlatformEvent::RawKeyDown, "",
"", "67", "", 67, 0, false, false, false, modifierKey, 0.0); |
203 RefPtrWillBeRawPtr<KeyboardEvent> keyEventC = KeyboardEvent::create(platform
KeyboardEventC, 0); | 203 RefPtrWillBeRawPtr<KeyboardEvent> keyEventC = KeyboardEvent::create(platform
KeyboardEventC, 0); |
204 ((WebPluginContainerImpl*)(pluginContainerOneElement.pluginContainer()))->ha
ndleEvent(keyEventC.get()); | 204 ((WebPluginContainerImpl*)(pluginContainerOneElement.pluginContainer()))->ha
ndleEvent(keyEventC.get()); |
205 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We
bClipboard::Buffer())); | 205 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We
bClipboard::Buffer())); |
206 | 206 |
207 // Clearing |Clipboard::Buffer()|. | 207 // Clearing |Clipboard::Buffer()|. |
208 Platform::current()->clipboard()->writePlainText(WebString("")); | 208 Platform::current()->clipboard()->writePlainText(WebString("")); |
209 EXPECT_EQ(WebString(""), Platform::current()->clipboard()->readPlainText(Web
Clipboard::Buffer())); | 209 EXPECT_EQ(WebString(""), Platform::current()->clipboard()->readPlainText(Web
Clipboard::Buffer())); |
210 | 210 |
211 PlatformKeyboardEvent platformKeyboardEventInsert(PlatformEvent::RawKeyDown,
"", "", "45", 45, 0, false, false, false, modifierKey, 0.0); | 211 PlatformKeyboardEvent platformKeyboardEventInsert(PlatformEvent::RawKeyDown,
"", "", "45", "", 45, 0, false, false, false, modifierKey, 0.0); |
212 RefPtrWillBeRawPtr<KeyboardEvent> keyEventInsert = KeyboardEvent::create(pla
tformKeyboardEventInsert, 0); | 212 RefPtrWillBeRawPtr<KeyboardEvent> keyEventInsert = KeyboardEvent::create(pla
tformKeyboardEventInsert, 0); |
213 ((WebPluginContainerImpl*)(pluginContainerOneElement.pluginContainer()))->ha
ndleEvent(keyEventInsert.get()); | 213 ((WebPluginContainerImpl*)(pluginContainerOneElement.pluginContainer()))->ha
ndleEvent(keyEventInsert.get()); |
214 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We
bClipboard::Buffer())); | 214 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We
bClipboard::Buffer())); |
215 } | 215 } |
216 } | 216 } |
OLD | NEW |