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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/ui/ppapi_uitest.h" 5 #include "chrome/test/ui/ppapi_uitest.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/stringprintf.h" 11 #include "base/stringprintf.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/test/test_timeouts.h" 13 #include "base/test/test_timeouts.h"
14 #include "base/timer.h" 14 #include "base/timer.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/browser_navigator.h" 17 #include "chrome/browser/ui/browser_navigator.h"
18 #include "chrome/common/chrome_paths.h" 18 #include "chrome/common/chrome_paths.h"
19 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
20 #include "chrome/test/base/in_process_browser_test.h" 20 #include "chrome/test/base/in_process_browser_test.h"
21 #include "chrome/test/base/ui_test_utils.h" 21 #include "chrome/test/base/ui_test_utils.h"
22 #include "content/public/browser/dom_operation_notification_details.h" 22 #include "content/public/browser/dom_operation_notification_details.h"
23 #include "content/public/browser/notification_types.h" 23 #include "content/public/browser/notification_types.h"
24 #include "content/public/browser/web_contents.h" 24 #include "content/public/browser/web_contents.h"
25 #include "content/public/common/content_paths.h" 25 #include "content/public/common/content_paths.h"
26 #include "content/public/common/content_switches.h" 26 #include "content/public/common/content_switches.h"
27 #include "content/public/common/url_constants.h" 27 #include "content/public/common/url_constants.h"
28 #include "content/public/test/test_renderer_host.h"
28 #include "media/audio/audio_manager.h" 29 #include "media/audio/audio_manager.h"
29 #include "net/base/net_util.h" 30 #include "net/base/net_util.h"
30 #include "net/test/test_server.h" 31 #include "net/test/test_server.h"
31 #include "webkit/plugins/plugin_switches.h" 32 #include "webkit/plugins/plugin_switches.h"
32 33
33 using content::DomOperationNotificationDetails; 34 using content::DomOperationNotificationDetails;
34 using content::RenderViewHost; 35 using content::RenderViewHost;
35 36
36 namespace { 37 namespace {
37 38
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 // Wait for the test completion event. 1087 // Wait for the test completion event.
1087 observer.Reset(); 1088 observer.Reset();
1088 1089
1089 // Switch back to the test tab. 1090 // Switch back to the test tab.
1090 browser()->ActivateTabAt(0, true); 1091 browser()->ActivateTabAt(0, true);
1091 1092
1092 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; 1093 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out.";
1093 EXPECT_STREQ("PASS", observer.result().c_str()); 1094 EXPECT_STREQ("PASS", observer.result().c_str());
1094 } 1095 }
1095 1096
1097 // Tests that if a plugin accepts touch events, the browser knows to send touch
1098 // events to the renderer.
1099 IN_PROC_BROWSER_TEST_F(PPAPITest, InputEvent_AcceptTouchEvent) {
1100 std::string positive_tests[] = { "InputEvent_AcceptTouchEvent_1",
1101 "InputEvent_AcceptTouchEvent_3",
1102 "InputEvent_AcceptTouchEvent_4"
1103 };
1104
1105 for (size_t i = 0; i < arraysize(positive_tests); ++i) {
1106 RenderViewHost* host = browser()->GetActiveWebContents()->
1107 GetRenderViewHost();
1108 RunTest(positive_tests[i]);
1109 EXPECT_TRUE(content::RenderViewHostTester::HasTouchEventHandler(host));
1110 }
1111
1112 std::string negative_tests[] = { "InputEvent_AcceptTouchEvent_2" };
1113 for (size_t i = 0; i < arraysize(negative_tests); ++i) {
1114 RenderViewHost* host = browser()->GetActiveWebContents()->
1115 GetRenderViewHost();
1116 RunTest(negative_tests[i]);
1117 EXPECT_FALSE(content::RenderViewHostTester::HasTouchEventHandler(host));
1118 }
1119 }
1120
1096 TEST_PPAPI_IN_PROCESS(View_SizeChange); 1121 TEST_PPAPI_IN_PROCESS(View_SizeChange);
1097 TEST_PPAPI_OUT_OF_PROCESS(View_SizeChange); 1122 TEST_PPAPI_OUT_OF_PROCESS(View_SizeChange);
1098 TEST_PPAPI_NACL_VIA_HTTP(View_SizeChange); 1123 TEST_PPAPI_NACL_VIA_HTTP(View_SizeChange);
1099 TEST_PPAPI_IN_PROCESS(View_ClipChange); 1124 TEST_PPAPI_IN_PROCESS(View_ClipChange);
1100 TEST_PPAPI_OUT_OF_PROCESS(View_ClipChange); 1125 TEST_PPAPI_OUT_OF_PROCESS(View_ClipChange);
1101 TEST_PPAPI_NACL_VIA_HTTP(View_ClipChange); 1126 TEST_PPAPI_NACL_VIA_HTTP(View_ClipChange);
1102 1127
1103 TEST_PPAPI_IN_PROCESS(ResourceArray_Basics) 1128 TEST_PPAPI_IN_PROCESS(ResourceArray_Basics)
1104 TEST_PPAPI_IN_PROCESS(ResourceArray_OutOfRangeAccess) 1129 TEST_PPAPI_IN_PROCESS(ResourceArray_OutOfRangeAccess)
1105 TEST_PPAPI_IN_PROCESS(ResourceArray_EmptyArray) 1130 TEST_PPAPI_IN_PROCESS(ResourceArray_EmptyArray)
1106 TEST_PPAPI_IN_PROCESS(ResourceArray_InvalidElement) 1131 TEST_PPAPI_IN_PROCESS(ResourceArray_InvalidElement)
1107 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_Basics) 1132 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_Basics)
1108 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_OutOfRangeAccess) 1133 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_OutOfRangeAccess)
1109 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_EmptyArray) 1134 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_EmptyArray)
1110 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_InvalidElement) 1135 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_InvalidElement)
1111 1136
1112 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_Basics) 1137 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_Basics)
1113 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_RunWithoutQuit) 1138 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_RunWithoutQuit)
1114 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_Basics) 1139 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_Basics)
1115 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit) 1140 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit)
1116 1141
1117 TEST_PPAPI_IN_PROCESS(MouseCursor) 1142 TEST_PPAPI_IN_PROCESS(MouseCursor)
1118 TEST_PPAPI_OUT_OF_PROCESS(MouseCursor) 1143 TEST_PPAPI_OUT_OF_PROCESS(MouseCursor)
1119 TEST_PPAPI_NACL_VIA_HTTP(MouseCursor) 1144 TEST_PPAPI_NACL_VIA_HTTP(MouseCursor)
1120 1145
1121 // Only enabled in out-of-process mode. 1146 // Only enabled in out-of-process mode.
1122 TEST_PPAPI_OUT_OF_PROCESS(FlashFile_CreateTemporaryFile) 1147 TEST_PPAPI_OUT_OF_PROCESS(FlashFile_CreateTemporaryFile)
1123 1148
1124 #endif // ADDRESS_SANITIZER 1149 #endif // ADDRESS_SANITIZER
OLDNEW
« 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