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

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: self-nits 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') | ppapi/tests/test_input_event.cc » ('J')
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 7476466f1e334c878d51c2a084dac20e2aa5cb2a..71d877960a7671e846d99b88133776033f513c09 100644
--- a/chrome/test/ui/ppapi_uitest.cc
+++ b/chrome/test/ui/ppapi_uitest.cc
@@ -25,6 +25,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 "media/audio/audio_manager.h"
#include "net/base/net_util.h"
#include "net/test/test_server.h"
@@ -1093,6 +1094,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') | ppapi/tests/test_input_event.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698