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

Side by Side Diff: chrome/test/automation/automation_proxy_uitest.cc

Issue 6354005: Remove action_max_timeout_ms and fix all the callers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 11 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) 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 "app/app_switches.h" 7 #include "app/app_switches.h"
8 #include "app/message_box_flags.h" 8 #include "app/message_box_flags.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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 scoped_refptr<BrowserProxy> window(automation_object->GetBrowserWindow(0)); 465 scoped_refptr<BrowserProxy> window(automation_object->GetBrowserWindow(0));
466 ASSERT_TRUE(window.get()); 466 ASSERT_TRUE(window.get());
467 scoped_refptr<TabProxy> tab(window->GetTab(0)); 467 scoped_refptr<TabProxy> tab(window->GetTab(0));
468 ASSERT_TRUE(tab.get()); 468 ASSERT_TRUE(tab.get());
469 469
470 FilePath filename(test_data_directory_); 470 FilePath filename(test_data_directory_);
471 filename = filename.AppendASCII("cookie1.html"); 471 filename = filename.AppendASCII("cookie1.html");
472 GURL newurl = net::FilePathToFileURL(filename); 472 GURL newurl = net::FilePathToFileURL(filename);
473 473
474 ASSERT_TRUE(tab->NavigateToURLAsync(newurl)); 474 ASSERT_TRUE(tab->NavigateToURLAsync(newurl));
475 std::string value = WaitUntilCookieNonEmpty(tab.get(), newurl, "foo", 475 std::string value = WaitUntilCookieNonEmpty(
476 action_max_timeout_ms()); 476 tab.get(), newurl, "foo", TestTimeouts::action_max_timeout_ms());
477 ASSERT_STREQ("baz", value.c_str()); 477 ASSERT_STREQ("baz", value.c_str());
478 } 478 }
479 479
480 TEST_F(AutomationProxyTest, AcceleratorNewTab) { 480 TEST_F(AutomationProxyTest, AcceleratorNewTab) {
481 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); 481 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
482 ASSERT_TRUE(window.get()); 482 ASSERT_TRUE(window.get());
483 483
484 int tab_count = -1; 484 int tab_count = -1;
485 ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB)); 485 ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB));
486 ASSERT_TRUE(window->GetTabCount(&tab_count)); 486 ASSERT_TRUE(window->GetTabCount(&tab_count));
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 643
644 scoped_refptr<TabProxy> tab(window->GetTab(0)); 644 scoped_refptr<TabProxy> tab(window->GetTab(0));
645 ASSERT_TRUE(tab.get()); 645 ASSERT_TRUE(tab.get());
646 646
647 FilePath filename(test_data_directory_); 647 FilePath filename(test_data_directory_);
648 filename = filename.AppendASCII("constrained_files"); 648 filename = filename.AppendASCII("constrained_files");
649 filename = filename.AppendASCII("constrained_window.html"); 649 filename = filename.AppendASCII("constrained_window.html");
650 650
651 ASSERT_TRUE(tab->NavigateToURL(net::FilePathToFileURL(filename))); 651 ASSERT_TRUE(tab->NavigateToURL(net::FilePathToFileURL(filename)));
652 652
653 ASSERT_TRUE(tab->WaitForBlockedPopupCountToChangeTo(2, 653 ASSERT_TRUE(tab->WaitForBlockedPopupCountToChangeTo(
654 action_max_timeout_ms())); 654 2, TestTimeouts::action_max_timeout_ms()));
655 } 655 }
656 656
657 // TODO(port): Remove HWND if possible 657 // TODO(port): Remove HWND if possible
658 #if defined(OS_WIN) 658 #if defined(OS_WIN)
659 659
660 const char simple_data_url[] = 660 const char simple_data_url[] =
661 "data:text/html,<html><head><title>External tab test</title></head>" 661 "data:text/html,<html><head><title>External tab test</title></head>"
662 "<body>A simple page for testing a floating/invisible tab<br></div>" 662 "<body>A simple page for testing a floating/invisible tab<br></div>"
663 "</body></html>"; 663 "</body></html>";
664 664
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 EXPECT_CALL(*mock_, OnDidNavigate(testing::_)) 907 EXPECT_CALL(*mock_, OnDidNavigate(testing::_))
908 .Times(1) 908 .Times(1)
909 .WillOnce(testing::InvokeWithoutArgs(mock_, 909 .WillOnce(testing::InvokeWithoutArgs(mock_,
910 &ExternalTabUITestMockClient::DestroyHostWindow)); 910 &ExternalTabUITestMockClient::DestroyHostWindow));
911 911
912 EXPECT_CALL(*mock_, HandleClosed(1)) 912 EXPECT_CALL(*mock_, HandleClosed(1))
913 .Times(1) 913 .Times(1)
914 .WillOnce(QUIT_LOOP(&loop)); 914 .WillOnce(QUIT_LOOP(&loop));
915 915
916 tab = mock_->CreateTabWithUrl(GURL(simple_data_url)); 916 tab = mock_->CreateTabWithUrl(GURL(simple_data_url));
917 loop.RunFor(action_max_timeout_ms()); 917 loop.RunFor(TestTimeouts::action_max_timeout_ms());
918 } 918 }
919 919
920 // Create with empty url and then navigate 920 // Create with empty url and then navigate
921 // Flaky, http://crbug.com/32293 921 // Flaky, http://crbug.com/32293
922 TEST_F(ExternalTabUITest, FLAKY_CreateExternalTab2) { 922 TEST_F(ExternalTabUITest, FLAKY_CreateExternalTab2) {
923 scoped_refptr<TabProxy> tab; 923 scoped_refptr<TabProxy> tab;
924 TimedMessageLoopRunner loop(MessageLoop::current()); 924 TimedMessageLoopRunner loop(MessageLoop::current());
925 ASSERT_THAT(mock_, testing::NotNull()); 925 ASSERT_THAT(mock_, testing::NotNull());
926 926
927 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) 927 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _))
928 .Times(testing::AnyNumber()); 928 .Times(testing::AnyNumber());
929 929
930 EXPECT_CALL(*mock_, OnDidNavigate(testing::_)) 930 EXPECT_CALL(*mock_, OnDidNavigate(testing::_))
931 .Times(1) 931 .Times(1)
932 .WillOnce(testing::InvokeWithoutArgs(mock_, 932 .WillOnce(testing::InvokeWithoutArgs(mock_,
933 &ExternalTabUITestMockClient::DestroyHostWindow)); 933 &ExternalTabUITestMockClient::DestroyHostWindow));
934 934
935 EXPECT_CALL(*mock_, HandleClosed(1)) 935 EXPECT_CALL(*mock_, HandleClosed(1))
936 .Times(1) 936 .Times(1)
937 .WillOnce(QUIT_LOOP(&loop)); 937 .WillOnce(QUIT_LOOP(&loop));
938 938
939 tab = mock_->CreateTabWithUrl(GURL()); 939 tab = mock_->CreateTabWithUrl(GURL());
940 mock_->NavigateInExternalTab(tab->handle(), GURL(simple_data_url)); 940 mock_->NavigateInExternalTab(tab->handle(), GURL(simple_data_url));
941 loop.RunFor(action_max_timeout_ms()); 941 loop.RunFor(TestTimeouts::action_max_timeout_ms());
942 } 942 }
943 943
944 // FLAKY: http://crbug.com/60409 944 // FLAKY: http://crbug.com/60409
945 TEST_F(ExternalTabUITest, FLAKY_IncognitoMode) { 945 TEST_F(ExternalTabUITest, FLAKY_IncognitoMode) {
946 scoped_refptr<TabProxy> tab; 946 scoped_refptr<TabProxy> tab;
947 TimedMessageLoopRunner loop(MessageLoop::current()); 947 TimedMessageLoopRunner loop(MessageLoop::current());
948 ASSERT_THAT(mock_, testing::NotNull()); 948 ASSERT_THAT(mock_, testing::NotNull());
949 949
950 GURL url("http://anatomyofmelancholy.net"); 950 GURL url("http://anatomyofmelancholy.net");
951 std::string cookie = "robert=burton; expires=Thu, 13 Oct 2011 05:04:03 UTC;"; 951 std::string cookie = "robert=burton; expires=Thu, 13 Oct 2011 05:04:03 UTC;";
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 testing::StrEq("Hello from gtest"), testing::_, testing::_)) 1017 testing::StrEq("Hello from gtest"), testing::_, testing::_))
1018 .Times(1) 1018 .Times(1)
1019 .WillOnce(testing::DoAll( 1019 .WillOnce(testing::DoAll(
1020 testing::InvokeWithoutArgs(CreateFunctor(mock_, 1020 testing::InvokeWithoutArgs(CreateFunctor(mock_,
1021 &ExternalTabUITestMockClient::DestroyHostWindow)), 1021 &ExternalTabUITestMockClient::DestroyHostWindow)),
1022 QUIT_LOOP_SOON(&loop, 50))); 1022 QUIT_LOOP_SOON(&loop, 50)));
1023 1023
1024 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); 1024 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1);
1025 1025
1026 tab = mock_->CreateTabWithUrl(GURL(content)); 1026 tab = mock_->CreateTabWithUrl(GURL(content));
1027 loop.RunFor(action_max_timeout_ms()); 1027 loop.RunFor(TestTimeouts::action_max_timeout_ms());
1028 } 1028 }
1029 1029
1030 // Flaky: http://crbug.com/62143 1030 // Flaky: http://crbug.com/62143
1031 TEST_F(ExternalTabUITest, FLAKY_PostMessageTarget) { 1031 TEST_F(ExternalTabUITest, FLAKY_PostMessageTarget) {
1032 net::TestServer test_server( 1032 net::TestServer test_server(
1033 net::TestServer::TYPE_HTTP, 1033 net::TestServer::TYPE_HTTP,
1034 FilePath(FILE_PATH_LITERAL("chrome/test/data/external_tab"))); 1034 FilePath(FILE_PATH_LITERAL("chrome/test/data/external_tab")));
1035 ASSERT_TRUE(test_server.Start()); 1035 ASSERT_TRUE(test_server.Start());
1036 1036
1037 scoped_refptr<TabProxy> tab; 1037 scoped_refptr<TabProxy> tab;
(...skipping 22 matching lines...) Expand all
1060 testing::InvokeWithoutArgs(CreateFunctor(mock_, 1060 testing::InvokeWithoutArgs(CreateFunctor(mock_,
1061 &ExternalTabUITestMockClient::DestroyHostWindow)), 1061 &ExternalTabUITestMockClient::DestroyHostWindow)),
1062 QUIT_LOOP_SOON(&loop, 50))); 1062 QUIT_LOOP_SOON(&loop, 50)));
1063 1063
1064 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); 1064 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1);
1065 1065
1066 ExternalTabSettings s = ExternalTabUITestMockClient::default_settings; 1066 ExternalTabSettings s = ExternalTabUITestMockClient::default_settings;
1067 s.load_requests_via_automation = false; 1067 s.load_requests_via_automation = false;
1068 s.initial_url = GURL("http://localhost:1337/files/post_message.html"); 1068 s.initial_url = GURL("http://localhost:1337/files/post_message.html");
1069 tab = mock_->CreateHostWindowAndTab(s); 1069 tab = mock_->CreateHostWindowAndTab(s);
1070 loop.RunFor(action_max_timeout_ms()); 1070 loop.RunFor(TestTimeouts::action_max_timeout_ms());
1071 } 1071 }
1072 1072
1073 // Flaky, http://crbug.com/42545. 1073 // Flaky, http://crbug.com/42545.
1074 TEST_F(ExternalTabUITest, FLAKY_HostNetworkStack) { 1074 TEST_F(ExternalTabUITest, FLAKY_HostNetworkStack) {
1075 scoped_refptr<TabProxy> tab; 1075 scoped_refptr<TabProxy> tab;
1076 TimedMessageLoopRunner loop(MessageLoop::current()); 1076 TimedMessageLoopRunner loop(MessageLoop::current());
1077 ASSERT_THAT(mock_, testing::NotNull()); 1077 ASSERT_THAT(mock_, testing::NotNull());
1078 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) 1078 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _))
1079 .Times(testing::AnyNumber()); 1079 .Times(testing::AnyNumber());
1080 EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); 1080 EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber());
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 testing::InvokeWithoutArgs(CreateFunctor(mock_, 1131 testing::InvokeWithoutArgs(CreateFunctor(mock_,
1132 &ExternalTabUITestMockClient::DestroyHostWindow)))); 1132 &ExternalTabUITestMockClient::DestroyHostWindow))));
1133 1133
1134 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); 1134 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1);
1135 1135
1136 EXPECT_CALL(*mock_, OnRequestRead(4, testing::Gt(0))) 1136 EXPECT_CALL(*mock_, OnRequestRead(4, testing::Gt(0)))
1137 .Times(1) 1137 .Times(1)
1138 .WillOnce(QUIT_LOOP_SOON(&loop, 300)); 1138 .WillOnce(QUIT_LOOP_SOON(&loop, 300));
1139 1139
1140 tab = mock_->CreateTabWithUrl(GURL(url)); 1140 tab = mock_->CreateTabWithUrl(GURL(url));
1141 loop.RunFor(action_max_timeout_ms()); 1141 loop.RunFor(TestTimeouts::action_max_timeout_ms());
1142 } 1142 }
1143 1143
1144 // Flaky, http://crbug.com/61023. 1144 // Flaky, http://crbug.com/61023.
1145 TEST_F(ExternalTabUITest, FLAKY_HostNetworkStackAbortRequest) { 1145 TEST_F(ExternalTabUITest, FLAKY_HostNetworkStackAbortRequest) {
1146 scoped_refptr<TabProxy> tab; 1146 scoped_refptr<TabProxy> tab;
1147 TimedMessageLoopRunner loop(MessageLoop::current()); 1147 TimedMessageLoopRunner loop(MessageLoop::current());
1148 ASSERT_THAT(mock_, testing::NotNull()); 1148 ASSERT_THAT(mock_, testing::NotNull());
1149 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) 1149 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _))
1150 .Times(testing::AnyNumber()); 1150 .Times(testing::AnyNumber());
1151 1151
(...skipping 21 matching lines...) Expand all
1173 testing::InvokeWithoutArgs(CreateFunctor(mock_, 1173 testing::InvokeWithoutArgs(CreateFunctor(mock_,
1174 &ExternalTabUITestMockClient::DestroyHostWindow)))); 1174 &ExternalTabUITestMockClient::DestroyHostWindow))));
1175 1175
1176 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); 1176 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1);
1177 1177
1178 EXPECT_CALL(*mock_, OnRequestEnd(2, testing::_)) 1178 EXPECT_CALL(*mock_, OnRequestEnd(2, testing::_))
1179 .Times(1) 1179 .Times(1)
1180 .WillOnce(QUIT_LOOP_SOON(&loop, 300)); 1180 .WillOnce(QUIT_LOOP_SOON(&loop, 300));
1181 1181
1182 tab = mock_->CreateTabWithUrl(GURL(url)); 1182 tab = mock_->CreateTabWithUrl(GURL(url));
1183 loop.RunFor(action_max_timeout_ms()); 1183 loop.RunFor(TestTimeouts::action_max_timeout_ms());
1184 } 1184 }
1185 1185
1186 // Flaky, http://crbug.com/61023. 1186 // Flaky, http://crbug.com/61023.
1187 TEST_F(ExternalTabUITest, FLAKY_HostNetworkStackUnresponsiveRenderer) { 1187 TEST_F(ExternalTabUITest, FLAKY_HostNetworkStackUnresponsiveRenderer) {
1188 scoped_refptr<TabProxy> tab; 1188 scoped_refptr<TabProxy> tab;
1189 TimedMessageLoopRunner loop(MessageLoop::current()); 1189 TimedMessageLoopRunner loop(MessageLoop::current());
1190 ASSERT_THAT(mock_, testing::NotNull()); 1190 ASSERT_THAT(mock_, testing::NotNull());
1191 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) 1191 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _))
1192 .Times(testing::AnyNumber()); 1192 .Times(testing::AnyNumber());
1193 EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); 1193 EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber());
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 .Times(testing::AnyNumber()) 1242 .Times(testing::AnyNumber())
1243 .WillOnce(testing::DoAll( 1243 .WillOnce(testing::DoAll(
1244 testing::InvokeWithoutArgs(CreateFunctor(mock_, 1244 testing::InvokeWithoutArgs(CreateFunctor(mock_,
1245 &ExternalTabUITestMockClient::ReplyData, &tail, 1, 2)), 1245 &ExternalTabUITestMockClient::ReplyData, &tail, 1, 2)),
1246 testing::InvokeWithoutArgs(CreateFunctor(mock_, 1246 testing::InvokeWithoutArgs(CreateFunctor(mock_,
1247 &ExternalTabUITestMockClient::ReplyEOF, 1, 2)), 1247 &ExternalTabUITestMockClient::ReplyEOF, 1, 2)),
1248 QUIT_LOOP_SOON(&loop, 300))); 1248 QUIT_LOOP_SOON(&loop, 300)));
1249 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); 1249 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1);
1250 1250
1251 tab = mock_->CreateTabWithUrl(GURL(url)); 1251 tab = mock_->CreateTabWithUrl(GURL(url));
1252 loop.RunFor(action_max_timeout_ms()); 1252 loop.RunFor(TestTimeouts::action_max_timeout_ms());
1253 mock_->DestroyHostWindow(); 1253 mock_->DestroyHostWindow();
1254 } 1254 }
1255 1255
1256 class ExternalTabUITestPopupEnabled : public ExternalTabUITest { 1256 class ExternalTabUITestPopupEnabled : public ExternalTabUITest {
1257 public: 1257 public:
1258 ExternalTabUITestPopupEnabled() { 1258 ExternalTabUITestPopupEnabled() {
1259 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); 1259 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking);
1260 } 1260 }
1261 }; 1261 };
1262 1262
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 .WillOnce(testing::WithArgs<0>(testing::Invoke(CreateFunctor(mock_, 1318 .WillOnce(testing::WithArgs<0>(testing::Invoke(CreateFunctor(mock_,
1319 &ExternalTabUITestMockClient::ConnectToExternalTab, popup1_host)))); 1319 &ExternalTabUITestMockClient::ConnectToExternalTab, popup1_host))));
1320 1320
1321 EXPECT_CALL(*mock_, OnAttachExternalTab(_)) 1321 EXPECT_CALL(*mock_, OnAttachExternalTab(_))
1322 .Times(1) 1322 .Times(1)
1323 .WillOnce(testing::WithArgs<0>(testing::Invoke(CreateFunctor(mock_, 1323 .WillOnce(testing::WithArgs<0>(testing::Invoke(CreateFunctor(mock_,
1324 &ExternalTabUITestMockClient::ConnectToExternalTab, popup2_host)))); 1324 &ExternalTabUITestMockClient::ConnectToExternalTab, popup2_host))));
1325 1325
1326 mock_->CreateTabWithUrl(main_url); 1326 mock_->CreateTabWithUrl(main_url);
1327 1327
1328 loop.RunFor(action_max_timeout_ms()); 1328 loop.RunFor(TestTimeouts::action_max_timeout_ms());
1329 1329
1330 EXPECT_CALL(*mock_, HandleClosed(1)); 1330 EXPECT_CALL(*mock_, HandleClosed(1));
1331 EXPECT_CALL(*mock_, HandleClosed(2)); 1331 EXPECT_CALL(*mock_, HandleClosed(2));
1332 EXPECT_CALL(*mock_, HandleClosed(3)); 1332 EXPECT_CALL(*mock_, HandleClosed(3));
1333 1333
1334 mock_->DestroyHostWindow(); 1334 mock_->DestroyHostWindow();
1335 ::DestroyWindow(popup1_host); 1335 ::DestroyWindow(popup1_host);
1336 ::DestroyWindow(popup2_host); 1336 ::DestroyWindow(popup2_host);
1337 } 1337 }
1338 1338
(...skipping 19 matching lines...) Expand all
1358 testing::InSequence s; 1358 testing::InSequence s;
1359 EXPECT_CALL(*mock_, OnLoad(_)) 1359 EXPECT_CALL(*mock_, OnLoad(_))
1360 .WillOnce(testing::InvokeWithoutArgs(testing::CreateFunctor(mock_, 1360 .WillOnce(testing::InvokeWithoutArgs(testing::CreateFunctor(mock_,
1361 &ExternalTabUITestMockClient::NavigateThroughUserGesture))); 1361 &ExternalTabUITestMockClient::NavigateThroughUserGesture)));
1362 1362
1363 EXPECT_CALL(*mock_, OnAttachExternalTab(_)) 1363 EXPECT_CALL(*mock_, OnAttachExternalTab(_))
1364 .Times(1) 1364 .Times(1)
1365 .WillOnce(QUIT_LOOP_SOON(&loop, 500)); 1365 .WillOnce(QUIT_LOOP_SOON(&loop, 500));
1366 1366
1367 mock_->CreateTabWithUrl(main_url); 1367 mock_->CreateTabWithUrl(main_url);
1368 loop.RunFor(action_max_timeout_ms()); 1368 loop.RunFor(TestTimeouts::action_max_timeout_ms());
1369 1369
1370 EXPECT_CALL(*mock_, HandleClosed(1)); 1370 EXPECT_CALL(*mock_, HandleClosed(1));
1371 ::DestroyWindow(foo_host); 1371 ::DestroyWindow(foo_host);
1372 mock_->DestroyHostWindow(); 1372 mock_->DestroyHostWindow();
1373 } 1373 }
1374 1374
1375 #endif // defined(OS_WIN) 1375 #endif // defined(OS_WIN)
1376 1376
1377 // TODO(port): Need to port autocomplete_edit_proxy.* first. 1377 // TODO(port): Need to port autocomplete_edit_proxy.* first.
1378 #if defined(OS_WIN) || defined(OS_LINUX) 1378 #if defined(OS_WIN) || defined(OS_LINUX)
(...skipping 21 matching lines...) Expand all
1400 scoped_refptr<AutocompleteEditProxy> edit1( 1400 scoped_refptr<AutocompleteEditProxy> edit1(
1401 browser1->GetAutocompleteEdit()); 1401 browser1->GetAutocompleteEdit());
1402 ASSERT_TRUE(edit1.get()); 1402 ASSERT_TRUE(edit1.get());
1403 EXPECT_TRUE(browser1->RunCommand(IDC_NEW_WINDOW)); 1403 EXPECT_TRUE(browser1->RunCommand(IDC_NEW_WINDOW));
1404 scoped_refptr<BrowserProxy> browser2(automation()->GetBrowserWindow(1)); 1404 scoped_refptr<BrowserProxy> browser2(automation()->GetBrowserWindow(1));
1405 ASSERT_TRUE(browser2.get()); 1405 ASSERT_TRUE(browser2.get());
1406 scoped_refptr<AutocompleteEditProxy> edit2( 1406 scoped_refptr<AutocompleteEditProxy> edit2(
1407 browser2->GetAutocompleteEdit()); 1407 browser2->GetAutocompleteEdit());
1408 ASSERT_TRUE(edit2.get()); 1408 ASSERT_TRUE(edit2.get());
1409 EXPECT_TRUE(browser2->GetTab(0)->WaitForTabToBeRestored( 1409 EXPECT_TRUE(browser2->GetTab(0)->WaitForTabToBeRestored(
1410 action_max_timeout_ms())); 1410 TestTimeouts::action_max_timeout_ms()));
1411 const std::wstring text_to_set1 = L"Lollerskates"; 1411 const std::wstring text_to_set1 = L"Lollerskates";
1412 const std::wstring text_to_set2 = L"Roflcopter"; 1412 const std::wstring text_to_set2 = L"Roflcopter";
1413 std::wstring actual_text1, actual_text2; 1413 std::wstring actual_text1, actual_text2;
1414 EXPECT_TRUE(edit1->SetText(text_to_set1)); 1414 EXPECT_TRUE(edit1->SetText(text_to_set1));
1415 EXPECT_TRUE(edit2->SetText(text_to_set2)); 1415 EXPECT_TRUE(edit2->SetText(text_to_set2));
1416 EXPECT_TRUE(edit1->GetText(&actual_text1)); 1416 EXPECT_TRUE(edit1->GetText(&actual_text1));
1417 EXPECT_TRUE(edit2->GetText(&actual_text2)); 1417 EXPECT_TRUE(edit2->GetText(&actual_text2));
1418 EXPECT_EQ(text_to_set1, actual_text1); 1418 EXPECT_EQ(text_to_set1, actual_text1);
1419 EXPECT_EQ(text_to_set2, actual_text2); 1419 EXPECT_EQ(text_to_set2, actual_text2);
1420 } 1420 }
(...skipping 10 matching lines...) Expand all
1431 TEST_F(AutomationProxyVisibleTest, AutocompleteMatchesTest) { 1431 TEST_F(AutomationProxyVisibleTest, AutocompleteMatchesTest) {
1432 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 1432 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
1433 ASSERT_TRUE(browser.get()); 1433 ASSERT_TRUE(browser.get());
1434 scoped_refptr<AutocompleteEditProxy> edit( 1434 scoped_refptr<AutocompleteEditProxy> edit(
1435 browser->GetAutocompleteEdit()); 1435 browser->GetAutocompleteEdit());
1436 ASSERT_TRUE(edit.get()); 1436 ASSERT_TRUE(edit.get());
1437 EXPECT_TRUE(edit->is_valid()); 1437 EXPECT_TRUE(edit->is_valid());
1438 EXPECT_TRUE(browser->ApplyAccelerator(IDC_FOCUS_LOCATION)); 1438 EXPECT_TRUE(browser->ApplyAccelerator(IDC_FOCUS_LOCATION));
1439 ASSERT_TRUE(edit->WaitForFocus()); 1439 ASSERT_TRUE(edit->WaitForFocus());
1440 EXPECT_TRUE(edit->SetText(L"Roflcopter")); 1440 EXPECT_TRUE(edit->SetText(L"Roflcopter"));
1441 EXPECT_TRUE(edit->WaitForQuery(action_max_timeout_ms())); 1441 EXPECT_TRUE(edit->WaitForQuery(TestTimeouts::action_max_timeout_ms()));
1442 bool query_in_progress; 1442 bool query_in_progress;
1443 EXPECT_TRUE(edit->IsQueryInProgress(&query_in_progress)); 1443 EXPECT_TRUE(edit->IsQueryInProgress(&query_in_progress));
1444 EXPECT_FALSE(query_in_progress); 1444 EXPECT_FALSE(query_in_progress);
1445 std::vector<AutocompleteMatchData> matches; 1445 std::vector<AutocompleteMatchData> matches;
1446 EXPECT_TRUE(edit->GetAutocompleteMatches(&matches)); 1446 EXPECT_TRUE(edit->GetAutocompleteMatches(&matches));
1447 EXPECT_FALSE(matches.empty()); 1447 EXPECT_FALSE(matches.empty());
1448 } 1448 }
1449 1449
1450 // Flaky especially on Windows. See crbug.com/25039. 1450 // Flaky especially on Windows. See crbug.com/25039.
1451 TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) { 1451 TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) {
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1747 int diff_pixels_count = 0; 1747 int diff_pixels_count = 0;
1748 for (int x = 0; x < img_size.width(); ++x) { 1748 for (int x = 0; x < img_size.width(); ++x) {
1749 for (int y = 0; y < img_size.height(); ++y) { 1749 for (int y = 0; y < img_size.height(); ++y) {
1750 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { 1750 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) {
1751 ++diff_pixels_count; 1751 ++diff_pixels_count;
1752 } 1752 }
1753 } 1753 }
1754 } 1754 }
1755 ASSERT_EQ(diff_pixels_count, 0); 1755 ASSERT_EQ(diff_pixels_count, 0);
1756 } 1756 }
OLDNEW
« no previous file with comments | « chrome/renderer/external_extension_uitest.cc ('k') | chrome/test/interactive_ui/keyboard_access_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698