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

Unified Diff: chrome/test/ui/ppapi_uitest.cc

Issue 10665007: ppapi: Add test for touch-event support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/public/test/test_renderer_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/ppapi_uitest.cc
diff --git a/chrome/test/ui/ppapi_uitest.cc b/chrome/test/ui/ppapi_uitest.cc
index 031fdf9f49583ea1632395385533b90f9240617f..76515d403ded49d8c4e38b8710f7a005c4e06011 100644
--- a/chrome/test/ui/ppapi_uitest.cc
+++ b/chrome/test/ui/ppapi_uitest.cc
@@ -26,6 +26,7 @@
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
+#include "content/public/test/test_renderer_host.h"
#include "content/test/gpu/test_switches.h"
#include "media/audio/audio_manager.h"
#include "net/base/net_util.h"
@@ -522,8 +523,8 @@ TEST_PPAPI_OUT_OF_PROCESS(Core)
#define MAYBE_InputEvent InputEvent
#endif
-TEST_PPAPI_IN_PROCESS(MAYBE_InputEvent)
-TEST_PPAPI_OUT_OF_PROCESS(MAYBE_InputEvent)
+TEST_PPAPI_IN_PROCESS(InputEvent)
+TEST_PPAPI_OUT_OF_PROCESS(InputEvent)
// TODO(bbudge) Enable when input events are proxied correctly for NaCl.
TEST_PPAPI_NACL_VIA_HTTP(DISABLED_InputEvent)
@@ -1108,6 +1109,30 @@ IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_PageHideShow) {
EXPECT_STREQ("PASS", observer.result().c_str());
}
+// Tests that if a plugin accepts touch events, the browser knows to send touch
+// events to the renderer.
+IN_PROC_BROWSER_TEST_F(PPAPITest, InputEvent_AcceptTouchEvent) {
+ std::string positive_tests[] = { "InputEvent_AcceptTouchEvent_1",
+ "InputEvent_AcceptTouchEvent_3",
+ "InputEvent_AcceptTouchEvent_4"
+ };
+
+ for (size_t i = 0; i < arraysize(positive_tests); ++i) {
+ RenderViewHost* host = browser()->GetActiveWebContents()->
+ GetRenderViewHost();
+ RunTest(positive_tests[i]);
+ EXPECT_TRUE(content::RenderViewHostTester::HasTouchEventHandler(host));
+ }
+
+ std::string negative_tests[] = { "InputEvent_AcceptTouchEvent_2" };
+ for (size_t i = 0; i < arraysize(negative_tests); ++i) {
+ RenderViewHost* host = browser()->GetActiveWebContents()->
+ GetRenderViewHost();
+ RunTest(negative_tests[i]);
+ EXPECT_FALSE(content::RenderViewHostTester::HasTouchEventHandler(host));
+ }
+}
+
TEST_PPAPI_IN_PROCESS(View_SizeChange);
TEST_PPAPI_OUT_OF_PROCESS(View_SizeChange);
TEST_PPAPI_NACL_VIA_HTTP(View_SizeChange);
« no previous file with comments | « no previous file | content/public/test/test_renderer_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698