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

Side by Side Diff: Source/web/tests/WebPluginContainerTest.cpp

Issue 933323002: Add experimental Support for DOM3 KeyboardEvent key value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added BugId for fixing lazy initialization Created 5 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
OLDNEW
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 webView->settings()->setPluginsEnabled(true); 194 webView->settings()->setPluginsEnabled(true);
195 webView->resize(WebSize(300, 300)); 195 webView->resize(WebSize(300, 300));
196 webView->layout(); 196 webView->layout();
197 runPendingTasks(); 197 runPendingTasks();
198 198
199 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE lementById(WebString::fromUTF8("translated-plugin")); 199 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE lementById(WebString::fromUTF8("translated-plugin"));
200 PlatformEvent::Modifiers modifierKey = PlatformEvent::CtrlKey; 200 PlatformEvent::Modifiers modifierKey = PlatformEvent::CtrlKey;
201 #if OS(MACOSX) 201 #if OS(MACOSX)
202 modifierKey = PlatformEvent::MetaKey; 202 modifierKey = PlatformEvent::MetaKey;
203 #endif 203 #endif
204 PlatformKeyboardEvent platformKeyboardEventC(PlatformEvent::RawKeyDown, "", "", "67", "", 67, 0, false, false, false, modifierKey, 0.0); 204 PlatformKeyboardEvent platformKeyboardEventC(PlatformEvent::RawKeyDown, "", "", "67", "", "", 67, 0, false, false, false, modifierKey, 0.0);
205 RefPtrWillBeRawPtr<KeyboardEvent> keyEventC = KeyboardEvent::create(platform KeyboardEventC, 0); 205 RefPtrWillBeRawPtr<KeyboardEvent> keyEventC = KeyboardEvent::create(platform KeyboardEventC, 0);
206 ((WebPluginContainerImpl*)(pluginContainerOneElement.pluginContainer()))->ha ndleEvent(keyEventC.get()); 206 ((WebPluginContainerImpl*)(pluginContainerOneElement.pluginContainer()))->ha ndleEvent(keyEventC.get());
207 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We bClipboard::Buffer())); 207 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We bClipboard::Buffer()));
208 208
209 // Clearing |Clipboard::Buffer()|. 209 // Clearing |Clipboard::Buffer()|.
210 Platform::current()->clipboard()->writePlainText(WebString("")); 210 Platform::current()->clipboard()->writePlainText(WebString(""));
211 EXPECT_EQ(WebString(""), Platform::current()->clipboard()->readPlainText(Web Clipboard::Buffer())); 211 EXPECT_EQ(WebString(""), Platform::current()->clipboard()->readPlainText(Web Clipboard::Buffer()));
212 212
213 PlatformKeyboardEvent platformKeyboardEventInsert(PlatformEvent::RawKeyDown, "", "", "45", "", 45, 0, false, false, false, modifierKey, 0.0); 213 PlatformKeyboardEvent platformKeyboardEventInsert(PlatformEvent::RawKeyDown, "", "", "45", "", "", 45, 0, false, false, false, modifierKey, 0.0);
214 RefPtrWillBeRawPtr<KeyboardEvent> keyEventInsert = KeyboardEvent::create(pla tformKeyboardEventInsert, 0); 214 RefPtrWillBeRawPtr<KeyboardEvent> keyEventInsert = KeyboardEvent::create(pla tformKeyboardEventInsert, 0);
215 ((WebPluginContainerImpl*)(pluginContainerOneElement.pluginContainer()))->ha ndleEvent(keyEventInsert.get()); 215 ((WebPluginContainerImpl*)(pluginContainerOneElement.pluginContainer()))->ha ndleEvent(keyEventInsert.get());
216 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We bClipboard::Buffer())); 216 EXPECT_EQ(WebString("x"), Platform::current()->clipboard()->readPlainText(We bClipboard::Buffer()));
217 } 217 }
218 } 218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698