| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 | 1073 |
| 1074 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); | 1074 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); |
| 1075 | 1075 |
| 1076 ExternalTabSettings s = ExternalTabUITestMockClient::default_settings; | 1076 ExternalTabSettings s = ExternalTabUITestMockClient::default_settings; |
| 1077 s.load_requests_via_automation = false; | 1077 s.load_requests_via_automation = false; |
| 1078 s.initial_url = GURL("http://localhost:1337/files/post_message.html"); | 1078 s.initial_url = GURL("http://localhost:1337/files/post_message.html"); |
| 1079 tab = mock_->CreateHostWindowAndTab(s); | 1079 tab = mock_->CreateHostWindowAndTab(s); |
| 1080 loop.RunFor(TestTimeouts::action_max_timeout_ms()); | 1080 loop.RunFor(TestTimeouts::action_max_timeout_ms()); |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 // Flaky, http://crbug.com/42545. | 1083 // Disabled, http://crbug.com/42545. |
| 1084 TEST_F(ExternalTabUITest, FLAKY_HostNetworkStack) { | 1084 TEST_F(ExternalTabUITest, DISABLED_HostNetworkStack) { |
| 1085 scoped_refptr<TabProxy> tab; | 1085 scoped_refptr<TabProxy> tab; |
| 1086 TimedMessageLoopRunner loop(MessageLoop::current()); | 1086 TimedMessageLoopRunner loop(MessageLoop::current()); |
| 1087 ASSERT_THAT(mock_, testing::NotNull()); | 1087 ASSERT_THAT(mock_, testing::NotNull()); |
| 1088 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) | 1088 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
| 1089 .Times(testing::AnyNumber()); | 1089 .Times(testing::AnyNumber()); |
| 1090 EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); | 1090 EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); |
| 1091 | 1091 |
| 1092 std::string url = "http://placetogo.org"; | 1092 std::string url = "http://placetogo.org"; |
| 1093 | 1093 |
| 1094 testing::InSequence sequence; | 1094 testing::InSequence sequence; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); | 1144 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); |
| 1145 | 1145 |
| 1146 EXPECT_CALL(*mock_, OnRequestRead(4, testing::Gt(0))) | 1146 EXPECT_CALL(*mock_, OnRequestRead(4, testing::Gt(0))) |
| 1147 .Times(1) | 1147 .Times(1) |
| 1148 .WillOnce(QUIT_LOOP_SOON(&loop, 300)); | 1148 .WillOnce(QUIT_LOOP_SOON(&loop, 300)); |
| 1149 | 1149 |
| 1150 tab = mock_->CreateTabWithUrl(GURL(url)); | 1150 tab = mock_->CreateTabWithUrl(GURL(url)); |
| 1151 loop.RunFor(TestTimeouts::action_max_timeout_ms()); | 1151 loop.RunFor(TestTimeouts::action_max_timeout_ms()); |
| 1152 } | 1152 } |
| 1153 | 1153 |
| 1154 // Flaky, http://crbug.com/61023. | 1154 // Disabled, http://crbug.com/61023. |
| 1155 TEST_F(ExternalTabUITest, FLAKY_HostNetworkStackAbortRequest) { | 1155 TEST_F(ExternalTabUITest, DISABLED_HostNetworkStackAbortRequest) { |
| 1156 scoped_refptr<TabProxy> tab; | 1156 scoped_refptr<TabProxy> tab; |
| 1157 TimedMessageLoopRunner loop(MessageLoop::current()); | 1157 TimedMessageLoopRunner loop(MessageLoop::current()); |
| 1158 ASSERT_THAT(mock_, testing::NotNull()); | 1158 ASSERT_THAT(mock_, testing::NotNull()); |
| 1159 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) | 1159 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
| 1160 .Times(testing::AnyNumber()); | 1160 .Times(testing::AnyNumber()); |
| 1161 | 1161 |
| 1162 std::string url = "http://placetogo.org"; | 1162 std::string url = "http://placetogo.org"; |
| 1163 | 1163 |
| 1164 testing::InSequence sequence; | 1164 testing::InSequence sequence; |
| 1165 EXPECT_CALL(*mock_, OnRequestStart(2, testing::AllOf( | 1165 EXPECT_CALL(*mock_, OnRequestStart(2, testing::AllOf( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1186 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); | 1186 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); |
| 1187 | 1187 |
| 1188 EXPECT_CALL(*mock_, OnRequestEnd(2, testing::_)) | 1188 EXPECT_CALL(*mock_, OnRequestEnd(2, testing::_)) |
| 1189 .Times(1) | 1189 .Times(1) |
| 1190 .WillOnce(QUIT_LOOP_SOON(&loop, 300)); | 1190 .WillOnce(QUIT_LOOP_SOON(&loop, 300)); |
| 1191 | 1191 |
| 1192 tab = mock_->CreateTabWithUrl(GURL(url)); | 1192 tab = mock_->CreateTabWithUrl(GURL(url)); |
| 1193 loop.RunFor(TestTimeouts::action_max_timeout_ms()); | 1193 loop.RunFor(TestTimeouts::action_max_timeout_ms()); |
| 1194 } | 1194 } |
| 1195 | 1195 |
| 1196 // Flaky, http://crbug.com/61023. | 1196 // Disabled, http://crbug.com/61023. |
| 1197 TEST_F(ExternalTabUITest, FLAKY_HostNetworkStackUnresponsiveRenderer) { | 1197 TEST_F(ExternalTabUITest, DISABLED_HostNetworkStackUnresponsiveRenderer) { |
| 1198 scoped_refptr<TabProxy> tab; | 1198 scoped_refptr<TabProxy> tab; |
| 1199 TimedMessageLoopRunner loop(MessageLoop::current()); | 1199 TimedMessageLoopRunner loop(MessageLoop::current()); |
| 1200 ASSERT_THAT(mock_, testing::NotNull()); | 1200 ASSERT_THAT(mock_, testing::NotNull()); |
| 1201 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) | 1201 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
| 1202 .Times(testing::AnyNumber()); | 1202 .Times(testing::AnyNumber()); |
| 1203 EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); | 1203 EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); |
| 1204 | 1204 |
| 1205 std::string url = "http://placetogo.org"; | 1205 std::string url = "http://placetogo.org"; |
| 1206 | 1206 |
| 1207 EXPECT_CALL(*mock_, OnRequestStart(3, testing::_)) | 1207 EXPECT_CALL(*mock_, OnRequestStart(3, testing::_)) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 | 1265 |
| 1266 class ExternalTabUITestPopupEnabled : public ExternalTabUITest { | 1266 class ExternalTabUITestPopupEnabled : public ExternalTabUITest { |
| 1267 public: | 1267 public: |
| 1268 ExternalTabUITestPopupEnabled() { | 1268 ExternalTabUITestPopupEnabled() { |
| 1269 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); | 1269 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); |
| 1270 } | 1270 } |
| 1271 }; | 1271 }; |
| 1272 | 1272 |
| 1273 #if defined(OS_WIN) | 1273 #if defined(OS_WIN) |
| 1274 // http://crbug.com/61023 - Fails on one popular operating system. | 1274 // http://crbug.com/61023 - Fails on one popular operating system. |
| 1275 #define MAYBE_WindowDotOpen FLAKY_WindowDotOpen | 1275 #define MAYBE_WindowDotOpen DISABLED_WindowDotOpen |
| 1276 #define MAYBE_UserGestureTargetBlank FLAKY_UserGestureTargetBlank | 1276 #define MAYBE_UserGestureTargetBlank DISABLED_UserGestureTargetBlank |
| 1277 #else | 1277 #else |
| 1278 #define MAYBE_WindowDotOpen WindowDotOpen | 1278 #define MAYBE_WindowDotOpen WindowDotOpen |
| 1279 #define MAYBE_UserGestureTargetBlank UserGestureTargetBlank | 1279 #define MAYBE_UserGestureTargetBlank UserGestureTargetBlank |
| 1280 #endif | 1280 #endif |
| 1281 | 1281 |
| 1282 // Testing AutomationMsg_AttachExternalTab callback from Chrome. | 1282 // Testing AutomationMsg_AttachExternalTab callback from Chrome. |
| 1283 // Open a popup window with window.open() call. The created popup window opens | 1283 // Open a popup window with window.open() call. The created popup window opens |
| 1284 // another popup window (again using window.open() call). | 1284 // another popup window (again using window.open() call). |
| 1285 TEST_F(ExternalTabUITestPopupEnabled, MAYBE_WindowDotOpen) { | 1285 TEST_F(ExternalTabUITestPopupEnabled, MAYBE_WindowDotOpen) { |
| 1286 TimedMessageLoopRunner loop(MessageLoop::current()); | 1286 TimedMessageLoopRunner loop(MessageLoop::current()); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1660 int diff_pixels_count = 0; | 1660 int diff_pixels_count = 0; |
| 1661 for (int x = 0; x < img_size.width(); ++x) { | 1661 for (int x = 0; x < img_size.width(); ++x) { |
| 1662 for (int y = 0; y < img_size.height(); ++y) { | 1662 for (int y = 0; y < img_size.height(); ++y) { |
| 1663 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { | 1663 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { |
| 1664 ++diff_pixels_count; | 1664 ++diff_pixels_count; |
| 1665 } | 1665 } |
| 1666 } | 1666 } |
| 1667 } | 1667 } |
| 1668 ASSERT_EQ(diff_pixels_count, 0); | 1668 ASSERT_EQ(diff_pixels_count, 0); |
| 1669 } | 1669 } |
| OLD | NEW |