| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 // Tests scripts panel showing. | 786 // Tests scripts panel showing. |
| 787 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestShowScriptsTab) { | 787 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestShowScriptsTab) { |
| 788 RunTest("testShowScriptsTab", kDebuggerTestPage); | 788 RunTest("testShowScriptsTab", kDebuggerTestPage); |
| 789 } | 789 } |
| 790 | 790 |
| 791 // Tests that scripts tab is populated with inspected scripts even if it | 791 // Tests that scripts tab is populated with inspected scripts even if it |
| 792 // hadn't been shown by the moment inspected paged refreshed. | 792 // hadn't been shown by the moment inspected paged refreshed. |
| 793 // @see http://crbug.com/26312 | 793 // @see http://crbug.com/26312 |
| 794 IN_PROC_BROWSER_TEST_F( | 794 IN_PROC_BROWSER_TEST_F( |
| 795 DevToolsSanityTest, | 795 DevToolsSanityTest, |
| 796 TestScriptsTabIsPopulatedOnInspectedPageRefresh) { | 796 DISABLED_TestScriptsTabIsPopulatedOnInspectedPageRefresh) { |
| 797 RunTest("testScriptsTabIsPopulatedOnInspectedPageRefresh", | 797 RunTest("testScriptsTabIsPopulatedOnInspectedPageRefresh", |
| 798 kDebuggerTestPage); | 798 kDebuggerTestPage); |
| 799 } | 799 } |
| 800 | 800 |
| 801 // Tests that chrome.devtools extension is correctly exposed. | 801 // Tests that chrome.devtools extension is correctly exposed. |
| 802 IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest, | 802 IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest, |
| 803 TestDevToolsExtensionAPI) { | 803 TestDevToolsExtensionAPI) { |
| 804 LoadExtension("devtools_extension"); | 804 LoadExtension("devtools_extension"); |
| 805 RunTest("waitForTestResultsInConsole", std::string()); | 805 RunTest("waitForTestResultsInConsole", std::string()); |
| 806 } | 806 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 RunTest("testNoScriptDuplicatesOnPanelSwitch", kDebuggerTestPage); | 903 RunTest("testNoScriptDuplicatesOnPanelSwitch", kDebuggerTestPage); |
| 904 } | 904 } |
| 905 | 905 |
| 906 // Tests that debugger works correctly if pause event occurs when DevTools | 906 // Tests that debugger works correctly if pause event occurs when DevTools |
| 907 // frontend is being loaded. | 907 // frontend is being loaded. |
| 908 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, | 908 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, |
| 909 TestPauseWhenLoadingDevTools) { | 909 TestPauseWhenLoadingDevTools) { |
| 910 RunTest("testPauseWhenLoadingDevTools", kPauseWhenLoadingDevTools); | 910 RunTest("testPauseWhenLoadingDevTools", kPauseWhenLoadingDevTools); |
| 911 } | 911 } |
| 912 | 912 |
| 913 // Tests that pressing 'Pause' will pause script execution if the script | |
| 914 // is already running. | |
| 915 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) | |
| 916 // Timing out on linux ARM bot: https://crbug/238453 | |
| 917 #define MAYBE_TestPauseWhenScriptIsRunning DISABLED_TestPauseWhenScriptIsRunning | |
| 918 #else | |
| 919 #define MAYBE_TestPauseWhenScriptIsRunning TestPauseWhenScriptIsRunning | |
| 920 #endif | |
| 921 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, | 913 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, |
| 922 MAYBE_TestPauseWhenScriptIsRunning) { | 914 DISABLED_TestPauseWhenScriptIsRunning) { |
| 923 RunTest("testPauseWhenScriptIsRunning", kPauseWhenScriptIsRunning); | 915 RunTest("testPauseWhenScriptIsRunning", kPauseWhenScriptIsRunning); |
| 924 } | 916 } |
| 925 | 917 |
| 926 // Tests network timing. | 918 // Tests network timing. |
| 927 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestNetworkTiming) { | 919 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestNetworkTiming) { |
| 928 RunTest("testNetworkTiming", kSlowTestPage); | 920 RunTest("testNetworkTiming", kSlowTestPage); |
| 929 } | 921 } |
| 930 | 922 |
| 931 // Tests network size. | 923 // Tests network size. |
| 932 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestNetworkSize) { | 924 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestNetworkSize) { |
| 933 RunTest("testNetworkSize", kChunkedTestPage); | 925 RunTest("testNetworkSize", kChunkedTestPage); |
| 934 } | 926 } |
| 935 | 927 |
| 936 // Tests raw headers text. | 928 // Tests raw headers text. |
| 937 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestNetworkSyncSize) { | 929 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestNetworkSyncSize) { |
| 938 RunTest("testNetworkSyncSize", kChunkedTestPage); | 930 RunTest("testNetworkSyncSize", kChunkedTestPage); |
| 939 } | 931 } |
| 940 | 932 |
| 941 // Tests raw headers text. | 933 // Tests raw headers text. |
| 942 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestNetworkRawHeadersText) { | 934 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestNetworkRawHeadersText) { |
| 943 RunTest("testNetworkRawHeadersText", kChunkedTestPage); | 935 RunTest("testNetworkRawHeadersText", kChunkedTestPage); |
| 944 } | 936 } |
| 945 | 937 |
| 946 // Tests that console messages are not duplicated on navigation back. | 938 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestConsoleOnNavigateBack) { |
| 947 #if defined(OS_WIN) | |
| 948 // Flaking on windows swarm try runs: crbug.com/409285. | |
| 949 #define MAYBE_TestConsoleOnNavigateBack DISABLED_TestConsoleOnNavigateBack | |
| 950 #else | |
| 951 #define MAYBE_TestConsoleOnNavigateBack TestConsoleOnNavigateBack | |
| 952 #endif | |
| 953 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, MAYBE_TestConsoleOnNavigateBack) { | |
| 954 RunTest("testConsoleOnNavigateBack", kNavigateBackTestPage); | 939 RunTest("testConsoleOnNavigateBack", kNavigateBackTestPage); |
| 955 } | 940 } |
| 956 | 941 |
| 957 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestDeviceEmulation) { | 942 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, DISABLED_TestDeviceEmulation) { |
| 958 RunTest("testDeviceMetricsOverrides", "about:blank"); | 943 RunTest("testDeviceMetricsOverrides", "about:blank"); |
| 959 } | 944 } |
| 960 | 945 |
| 961 // Tests that settings are stored in profile correctly. | 946 // Tests that settings are stored in profile correctly. |
| 962 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestSettings) { | 947 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestSettings) { |
| 963 OpenDevToolsWindow("about:blank", true); | 948 OpenDevToolsWindow("about:blank", true); |
| 964 RunTestFunction(window_, "testSettings"); | 949 RunTestFunction(window_, "testSettings"); |
| 965 CloseDevToolsWindow(); | 950 CloseDevToolsWindow(); |
| 966 } | 951 } |
| 967 | 952 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 DispatchOnTestSuite(window_, "enableAutoAttachToCreatedPages"); | 1075 DispatchOnTestSuite(window_, "enableAutoAttachToCreatedPages"); |
| 1091 DevToolsWindowCreationObserver observer; | 1076 DevToolsWindowCreationObserver observer; |
| 1092 ASSERT_TRUE(content::ExecuteScript( | 1077 ASSERT_TRUE(content::ExecuteScript( |
| 1093 GetInspectedTab(), "window.open('window_open.html', '_blank');")); | 1078 GetInspectedTab(), "window.open('window_open.html', '_blank');")); |
| 1094 observer.WaitForLoad(); | 1079 observer.WaitForLoad(); |
| 1095 DispatchOnTestSuite(observer.devtools_window(), "waitForDebuggerPaused"); | 1080 DispatchOnTestSuite(observer.devtools_window(), "waitForDebuggerPaused"); |
| 1096 DevToolsWindowTesting::CloseDevToolsWindowSync(observer.devtools_window()); | 1081 DevToolsWindowTesting::CloseDevToolsWindowSync(observer.devtools_window()); |
| 1097 CloseDevToolsWindow(); | 1082 CloseDevToolsWindow(); |
| 1098 } | 1083 } |
| 1099 | 1084 |
| 1100 IN_PROC_BROWSER_TEST_F(WorkerDevToolsSanityTest, InspectSharedWorker) { | 1085 IN_PROC_BROWSER_TEST_F(WorkerDevToolsSanityTest, DISABLED_InspectSharedWorker) { |
| 1101 #if defined(OS_WIN) && defined(USE_ASH) | 1086 #if defined(OS_WIN) && defined(USE_ASH) |
| 1102 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 1087 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
| 1103 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1088 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1104 switches::kAshBrowserTests)) | 1089 switches::kAshBrowserTests)) |
| 1105 return; | 1090 return; |
| 1106 #endif | 1091 #endif |
| 1107 | 1092 |
| 1108 RunTest("testSharedWorker", kSharedWorkerTestPage, kSharedWorkerTestWorker); | 1093 RunTest("testSharedWorker", kSharedWorkerTestPage, kSharedWorkerTestWorker); |
| 1109 } | 1094 } |
| 1110 | 1095 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 } | 1176 } |
| 1192 | 1177 |
| 1193 class DevToolsPixelOutputTests : public DevToolsSanityTest { | 1178 class DevToolsPixelOutputTests : public DevToolsSanityTest { |
| 1194 public: | 1179 public: |
| 1195 void SetUpCommandLine(base::CommandLine* command_line) override { | 1180 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1196 command_line->AppendSwitch(switches::kEnablePixelOutputInTests); | 1181 command_line->AppendSwitch(switches::kEnablePixelOutputInTests); |
| 1197 command_line->AppendSwitch(switches::kUseGpuInTests); | 1182 command_line->AppendSwitch(switches::kUseGpuInTests); |
| 1198 } | 1183 } |
| 1199 }; | 1184 }; |
| 1200 | 1185 |
| 1201 // This test enables switches::kUseGpuInTests which causes false positives | |
| 1202 // with MemorySanitizer. | |
| 1203 #if defined(MEMORY_SANITIZER) || defined(ADDRESS_SANITIZER) || \ | |
| 1204 (defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD)) | |
| 1205 #define MAYBE_TestScreenshotRecording DISABLED_TestScreenshotRecording | |
| 1206 #else | |
| 1207 #define MAYBE_TestScreenshotRecording TestScreenshotRecording | |
| 1208 #endif | |
| 1209 IN_PROC_BROWSER_TEST_F(DevToolsPixelOutputTests, | 1186 IN_PROC_BROWSER_TEST_F(DevToolsPixelOutputTests, |
| 1210 MAYBE_TestScreenshotRecording) { | 1187 DISABLED_TestScreenshotRecording) { |
| 1211 RunTest("testScreenshotRecording", std::string()); | 1188 RunTest("testScreenshotRecording", std::string()); |
| 1212 } | 1189 } |
| 1213 | 1190 |
| 1214 // This test enables switches::kUseGpuInTests which causes false positives | |
| 1215 // with MemorySanitizer. | |
| 1216 #if defined(MEMORY_SANITIZER) || defined(ADDRESS_SANITIZER) | |
| 1217 #define MAYBE_TestLatencyInfoInstrumentation \ | |
| 1218 DISABLED_TestLatencyInfoInstrumentation | |
| 1219 #else | |
| 1220 #define MAYBE_TestLatencyInfoInstrumentation TestLatencyInfoInstrumentation | |
| 1221 #endif | |
| 1222 IN_PROC_BROWSER_TEST_F(DevToolsPixelOutputTests, | 1191 IN_PROC_BROWSER_TEST_F(DevToolsPixelOutputTests, |
| 1223 MAYBE_TestLatencyInfoInstrumentation) { | 1192 DISABLED_TestLatencyInfoInstrumentation) { |
| 1224 WebContents* web_contents = GetInspectedTab(); | 1193 WebContents* web_contents = GetInspectedTab(); |
| 1225 OpenDevToolsWindow(kLatencyInfoTestPage, false); | 1194 OpenDevToolsWindow(kLatencyInfoTestPage, false); |
| 1226 RunTestMethod("enableExperiment", "timelineLatencyInfo"); | 1195 RunTestMethod("enableExperiment", "timelineLatencyInfo"); |
| 1227 DispatchAndWait("startTimeline"); | 1196 DispatchAndWait("startTimeline"); |
| 1228 | 1197 |
| 1229 for (int i = 0; i < 3; ++i) { | 1198 for (int i = 0; i < 3; ++i) { |
| 1230 SimulateMouseEvent(web_contents, blink::WebInputEvent::MouseMove, | 1199 SimulateMouseEvent(web_contents, blink::WebInputEvent::MouseMove, |
| 1231 gfx::Point(30, 60)); | 1200 gfx::Point(30, 60)); |
| 1232 DispatchInPageAndWait("waitForEvent", "mousemove"); | 1201 DispatchInPageAndWait("waitForEvent", "mousemove"); |
| 1233 } | 1202 } |
| 1234 | 1203 |
| 1235 SimulateMouseClickAt(web_contents, 0, blink::WebPointerProperties::ButtonLeft, | 1204 SimulateMouseClickAt(web_contents, 0, blink::WebPointerProperties::ButtonLeft, |
| 1236 gfx::Point(30, 60)); | 1205 gfx::Point(30, 60)); |
| 1237 DispatchInPageAndWait("waitForEvent", "click"); | 1206 DispatchInPageAndWait("waitForEvent", "click"); |
| 1238 | 1207 |
| 1239 SimulateMouseWheelEvent(web_contents, gfx::Point(300, 100), | 1208 SimulateMouseWheelEvent(web_contents, gfx::Point(300, 100), |
| 1240 gfx::Vector2d(0, 120)); | 1209 gfx::Vector2d(0, 120)); |
| 1241 DispatchInPageAndWait("waitForEvent", "wheel"); | 1210 DispatchInPageAndWait("waitForEvent", "wheel"); |
| 1242 | 1211 |
| 1243 SimulateTapAt(web_contents, gfx::Point(30, 60)); | 1212 SimulateTapAt(web_contents, gfx::Point(30, 60)); |
| 1244 DispatchInPageAndWait("waitForEvent", "gesturetap"); | 1213 DispatchInPageAndWait("waitForEvent", "gesturetap"); |
| 1245 | 1214 |
| 1246 DispatchAndWait("stopTimeline"); | 1215 DispatchAndWait("stopTimeline"); |
| 1247 RunTestMethod("checkInputEventsPresent", "MouseMove", "MouseDown", | 1216 RunTestMethod("checkInputEventsPresent", "MouseMove", "MouseDown", |
| 1248 "MouseWheel", "GestureTap"); | 1217 "MouseWheel", "GestureTap"); |
| 1249 | 1218 |
| 1250 CloseDevToolsWindow(); | 1219 CloseDevToolsWindow(); |
| 1251 } | 1220 } |
| OLD | NEW |