diff options
13 files changed, 41 insertions, 73 deletions
diff --git a/chrome/common/gpu_plugin.cc b/chrome/common/gpu_plugin.cc index af009f9..d9d67db 100644 --- a/chrome/common/gpu_plugin.cc +++ b/chrome/common/gpu_plugin.cc @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/gpu_plugin.h" - #include "base/command_line.h" #include "base/string_util.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/gpu_plugin.h" #include "gpu/gpu_plugin/gpu_plugin.h" #include "webkit/glue/plugins/plugin_list.h" diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/http/tests/plugins/plugin-document-has-focus-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/http/tests/plugins/plugin-document-has-focus-expected.txt deleted file mode 100644 index 07a9506..0000000 --- a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/http/tests/plugins/plugin-document-has-focus-expected.txt +++ /dev/null @@ -1,3 +0,0 @@ -CONSOLE MESSAGE: line 1: PLUGIN: keyDown 'A' -CONSOLE MESSAGE: line 1: PLUGIN: keyUp 'A' -This tests that a full page plugin gets keyboard focus without the need to first click it.
\ No newline at end of file diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/README b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/README index 5e2667d..b3f7df8 100644 --- a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/README +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/README @@ -4,12 +4,4 @@ inner-html-display-none ----------------------- The only difference is whitespace differences in the -way functions are printed. - - -keyboard-events ---------------- - -On Windows, windowless plugins get the shift state of the keyboard by quering the OS, since the -WM_KEYDOWN message doesn't contain that information. This is impossible to simulate through -eventSender().
\ No newline at end of file +way functions are printed.
\ No newline at end of file diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/keyboard-events-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/keyboard-events-expected.txt deleted file mode 100644 index c944349..0000000 --- a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/keyboard-events-expected.txt +++ /dev/null @@ -1,11 +0,0 @@ -CONSOLE MESSAGE: line 17: PLUGIN: getFocusEvent -CONSOLE MESSAGE: line 17: PLUGIN: mouseDown at (20, 20) -CONSOLE MESSAGE: line 18: PLUGIN: mouseUp at (20, 20) -CONSOLE MESSAGE: line 21: PLUGIN: keyDown 'A' -CONSOLE MESSAGE: line 21: PLUGIN: keyUp 'A' -CONSOLE MESSAGE: line 22: PLUGIN: keyDown 'B' -CONSOLE MESSAGE: line 22: PLUGIN: keyUp 'B' -CONSOLE MESSAGE: line 23: PLUGIN: keyDown 'C' -CONSOLE MESSAGE: line 23: PLUGIN: keyUp 'C' - -This test checks if a plug-in can receive keyboard events sent from eventSender. This is a test for Bug 34936. diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index 66b3cb4..624a893 100644 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -2789,6 +2789,7 @@ BUG37896 WIN DEBUG : fast/text/firstline/001.html = PASS CRASH BUG37896 LINUX MAC DEBUG : fast/text/firstline/001.html = PASS CRASH TIMEOUT // Added in http://trac.webkit.org/changeset/55587 BUG37896 : media/video-preload.html = TEXT +BUG37896 : plugins/keyboard-events.html = TEXT BUG37896 LINUX DEBUG : fast/images/svg-as-background.html = TIMEOUT BUG37869 LINUX : fast/images/animated-svg-as-image.html = IMAGE BUG37869 MAC LINUX SKIP : inspector/timeline-network-resource.html = CRASH @@ -2830,9 +2831,5 @@ BUG36415 : fast/events/touch/basic-multi-touch-events.html = TEXT // Most touch tests flaky on WIN for reasons currently unknown. BUG38347 WIN : fast/events/touch = TEXT PASS -// Need to implement NPP_HandleEvent in the layout_test_plugin -BUG38353 MAC LINUX : plugins/keyboard-events.html = TEXT -BUG38353 MAC LINUX : http/tests/plugins/plugin-document-has-focus.html = TEXT - // will rebaseline -BUG_DGLAZKOV WIN : svg/text/text-intro-05-t.svg = FAIL
\ No newline at end of file +BUG_DGLAZKOV WIN : svg/text/text-intro-05-t.svg = FAIL diff --git a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp index 026d74f..4b310ef 100644 --- a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp +++ b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp @@ -982,7 +982,6 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass) newInstance->testDocumentOpenInDestroyStream = FALSE; newInstance->testWindowOpen = FALSE; - newInstance->testKeyboardFocusForPlugins = FALSE; return (NPObject*)newInstance; } diff --git a/webkit/tools/npapi_layout_test_plugin/PluginObject.h b/webkit/tools/npapi_layout_test_plugin/PluginObject.h index 8cd63ef..5cab228 100644 --- a/webkit/tools/npapi_layout_test_plugin/PluginObject.h +++ b/webkit/tools/npapi_layout_test_plugin/PluginObject.h @@ -38,7 +38,6 @@ typedef struct { NPStream* stream; NPBool testWindowOpen; NPBool testDocumentOpenInDestroyStream; - NPBool testKeyboardFocusForPlugins; char* onStreamLoad; char* onStreamDestroy; char* onURLNotify; diff --git a/webkit/tools/npapi_layout_test_plugin/main.cpp b/webkit/tools/npapi_layout_test_plugin/main.cpp index 9ff3ebb..a644d03 100644 --- a/webkit/tools/npapi_layout_test_plugin/main.cpp +++ b/webkit/tools/npapi_layout_test_plugin/main.cpp @@ -140,8 +140,7 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch obj->testDocumentOpenInDestroyStream = TRUE; } else if (strcasecmp(argn[i], "testwindowopen") == 0) { obj->testWindowOpen = TRUE; - } else if (strcasecmp(argn[i], "src") == 0 && strstr(argv[i], "plugin-document-has-focus.pl")) - obj->testKeyboardFocusForPlugins = TRUE; + } } instance->pdata = obj; @@ -183,18 +182,13 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) if (obj->logSetWindow) { log(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); fflush(stdout); - obj->logSetWindow = FALSE; + obj->logSetWindow = false; } if (obj->testWindowOpen) { testWindowOpen(instance); obj->testWindowOpen = FALSE; } - - if (obj->testKeyboardFocusForPlugins) { - obj->eventLogging = true; - executeScript(obj, "eventSender.keyDown('A');"); - } } return NPERR_NO_ERROR; @@ -298,17 +292,17 @@ int16 NPP_HandleEvent(NPP instance, void *event) case WM_RBUTTONDBLCLK: break; case WM_MOUSEMOVE: + log(instance, "adjustCursorEvent"); break; case WM_KEYUP: - log(instance, "keyUp '%c'", MapVirtualKey(evt->wParam, MAPVK_VK_TO_CHAR)); - if (obj->testKeyboardFocusForPlugins) { - obj->eventLogging = false; - obj->testKeyboardFocusForPlugins = FALSE; - executeScript(obj, "layoutTestController.notifyDone();"); - } + // TODO(tc): We need to convert evt->wParam from virtual-key code + // to key code. + log(instance, "NOTIMPLEMENTED: keyUp '%c'", ' '); break; case WM_KEYDOWN: - log(instance, "keyDown '%c'", MapVirtualKey(evt->wParam, MAPVK_VK_TO_CHAR)); + // TODO(tc): We need to convert evt->wParam from virtual-key code + // to key code. + log(instance, "NOTIMPLEMENTED: keyDown '%c'", ' '); break; case WM_SETCURSOR: break; diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc index 9cc100f..2ab01a0 100644 --- a/webkit/tools/test_shell/event_sending_controller.cc +++ b/webkit/tools/test_shell/event_sending_controller.cc @@ -60,6 +60,7 @@ using WebKit::WebTouchEvent; using WebKit::WebTouchPoint; using WebKit::WebView; +TestShell* EventSendingController::shell_ = NULL; gfx::Point EventSendingController::last_mouse_pos_; WebMouseEvent::Button EventSendingController::pressed_button_ = WebMouseEvent::ButtonNone; @@ -251,8 +252,13 @@ enum KeyLocationCode { } // anonymous namespace EventSendingController::EventSendingController(TestShell* shell) - : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), - shell_(shell) { + : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { + // Set static shell_ variable since we can't do it in an initializer list. + // We also need to be careful not to assign shell_ to new windows which are + // temporary. + if (NULL == shell_) + shell_ = shell; + // Initialize the map that associates methods of this class with the names // they will use when called by JavaScript. The actual binding of those // names to their methods will be done by calling BindToJavaScript() (defined @@ -332,10 +338,12 @@ void EventSendingController::Reset() { touch_points.clear(); } +// static WebView* EventSendingController::webview() { return shell_->webView(); } +// static void EventSendingController::DoDragDrop(const WebKit::WebPoint &event_pos, const WebDragData& drag_data, WebDragOperationsMask mask) { @@ -443,6 +451,7 @@ void EventSendingController::mouseUp( } } +// static void EventSendingController::DoMouseUp(const WebMouseEvent& e) { webview()->handleInputEvent(e); @@ -521,6 +530,7 @@ void EventSendingController::mouseWheelTo( } } +// static void EventSendingController::DoMouseMove(const WebMouseEvent& e) { last_mouse_pos_.SetPoint(e.x, e.y); diff --git a/webkit/tools/test_shell/event_sending_controller.h b/webkit/tools/test_shell/event_sending_controller.h index da7e4df..4c3c9f2 100644 --- a/webkit/tools/test_shell/event_sending_controller.h +++ b/webkit/tools/test_shell/event_sending_controller.h @@ -41,9 +41,9 @@ class EventSendingController : public CppBoundClass { void Reset(); // Simulate drag&drop system call. - void DoDragDrop(const WebKit::WebPoint &event_pos, - const WebKit::WebDragData& drag_data, - WebKit::WebDragOperationsMask operations_mask); + static void DoDragDrop(const WebKit::WebPoint &event_pos, + const WebKit::WebDragData& drag_data, + WebKit::WebDragOperationsMask operations_mask); // JS callback methods. void mouseDown(const CppArgumentList& args, CppVariant* result); @@ -93,17 +93,17 @@ class EventSendingController : public CppBoundClass { private: // Returns the test shell's webview. - WebKit::WebView* webview(); + static WebKit::WebView* webview(); // Returns true if dragMode is true. bool drag_mode() { return dragMode.isBool() && dragMode.ToBoolean(); } // Sometimes we queue up mouse move and mouse up events for drag drop // handling purposes. These methods dispatch the event. - void DoMouseMove(const WebKit::WebMouseEvent& e); - void DoMouseUp(const WebKit::WebMouseEvent& e); + static void DoMouseMove(const WebKit::WebMouseEvent& e); + static void DoMouseUp(const WebKit::WebMouseEvent& e); static void DoLeapForward(int milliseconds); - void ReplaySavedEvents(); + static void ReplaySavedEvents(); // Helper to return the button type given a button code static WebKit::WebMouseEvent::Button GetButtonTypeFromButtonNumber( @@ -125,7 +125,7 @@ class EventSendingController : public CppBoundClass { ScopedRunnableMethodFactory<EventSendingController> method_factory_; // Non-owning pointer. The LayoutTestController is owned by the host. - TestShell* shell_; + static TestShell* shell_; // Location of last mouseMoveTo event. static gfx::Point last_mouse_pos_; diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h index 9595a47..10f6371 100644 --- a/webkit/tools/test_shell/test_shell.h +++ b/webkit/tools/test_shell/test_shell.h @@ -156,9 +156,6 @@ public: TestNavigationController* navigation_controller() { return navigation_controller_.get(); } - EventSendingController* event_sending_controller() { - return event_sending_controller_.get(); - } // Resets the LayoutTestController and EventSendingController. Should be // called before loading a page, since some end-editing event notifications diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc index 8d7f8ec7..8ce1bcb 100644 --- a/webkit/tools/test_shell/test_shell_win.cc +++ b/webkit/tools/test_shell/test_shell_win.cc @@ -275,17 +275,13 @@ bool TestShell::RunFileTest(const TestParams& params) { if (inspector_test_mode_) shell->ShowDevTools(); - GURL url(params.test_url); - if (url.is_valid()) { // Don't hang if we have an invalid path. - shell->test_is_preparing_ = true; - shell->set_test_params(¶ms); - shell->LoadURL(url); - shell->test_is_preparing_ = false; - shell->WaitTestFinished(); - shell->set_test_params(NULL); - } else { - NOTREACHED() << "Invalid url: " << url.spec(); - } + shell->test_is_preparing_ = true; + shell->set_test_params(¶ms); + shell->LoadURL(GURL(params.test_url)); + + shell->test_is_preparing_ = false; + shell->WaitTestFinished(); + shell->set_test_params(NULL); return true; } diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 5a1f2e4..a03569c 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -558,8 +558,7 @@ void TestWebViewDelegate::startDragging( // When running a test, we need to fake a drag drop operation otherwise // Windows waits for real mouse events to know when the drag is over. - shell_->event_sending_controller()->DoDragDrop( - mouse_coords, mutable_drag_data, mask); + EventSendingController::DoDragDrop(mouse_coords, mutable_drag_data, mask); } else { // TODO(tc): Drag and drop is disabled in the test shell because we need // to be able to convert from WebDragData to an IDataObject. |