OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 12 matching lines...) Expand all Loading... |
23 #include "chrome/test/automation/autocomplete_edit_proxy.h" | 23 #include "chrome/test/automation/autocomplete_edit_proxy.h" |
24 #include "chrome/test/automation/automation_messages.h" | 24 #include "chrome/test/automation/automation_messages.h" |
25 #include "chrome/test/automation/automation_proxy_uitest.h" | 25 #include "chrome/test/automation/automation_proxy_uitest.h" |
26 #include "chrome/test/automation/browser_proxy.h" | 26 #include "chrome/test/automation/browser_proxy.h" |
27 #include "chrome/test/automation/tab_proxy.h" | 27 #include "chrome/test/automation/tab_proxy.h" |
28 #include "chrome/test/automation/window_proxy.h" | 28 #include "chrome/test/automation/window_proxy.h" |
29 #include "chrome/test/ui_test_utils.h" | 29 #include "chrome/test/ui_test_utils.h" |
30 #include "chrome/test/ui/ui_test.h" | 30 #include "chrome/test/ui/ui_test.h" |
31 #include "gfx/rect.h" | 31 #include "gfx/rect.h" |
32 #include "net/base/net_util.h" | 32 #include "net/base/net_util.h" |
33 #include "net/url_request/url_request_unittest.h" | 33 #include "net/test/test_server.h" |
34 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING | 34 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
35 #include "testing/gmock_mutant.h" | 35 #include "testing/gmock_mutant.h" |
36 #include "views/event.h" | 36 #include "views/event.h" |
37 | 37 |
38 using ui_test_utils::TimedMessageLoopRunner; | 38 using ui_test_utils::TimedMessageLoopRunner; |
39 using testing::CreateFunctor; | 39 using testing::CreateFunctor; |
40 using testing::StrEq; | 40 using testing::StrEq; |
41 using testing::_; | 41 using testing::_; |
42 | 42 |
43 class AutomationProxyTest : public UITest { | 43 class AutomationProxyTest : public UITest { |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 QUIT_LOOP_SOON(&loop, 50))); | 964 QUIT_LOOP_SOON(&loop, 50))); |
965 | 965 |
966 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); | 966 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); |
967 | 967 |
968 tab = mock_->CreateTabWithUrl(GURL(content)); | 968 tab = mock_->CreateTabWithUrl(GURL(content)); |
969 loop.RunFor(action_max_timeout_ms()); | 969 loop.RunFor(action_max_timeout_ms()); |
970 } | 970 } |
971 | 971 |
972 TEST_F(ExternalTabUITest, FLAKY_PostMessageTarget) { | 972 TEST_F(ExternalTabUITest, FLAKY_PostMessageTarget) { |
973 const wchar_t kDocRoot[] = L"chrome/test/data/external_tab"; | 973 const wchar_t kDocRoot[] = L"chrome/test/data/external_tab"; |
974 scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); | 974 scoped_refptr<net::HTTPTestServer> server( |
| 975 net::HTTPTestServer::CreateServer(kDocRoot)); |
975 ASSERT_THAT(server.get(), testing::NotNull()); | 976 ASSERT_THAT(server.get(), testing::NotNull()); |
976 | 977 |
977 scoped_refptr<TabProxy> tab; | 978 scoped_refptr<TabProxy> tab; |
978 TimedMessageLoopRunner loop(MessageLoop::current()); | 979 TimedMessageLoopRunner loop(MessageLoop::current()); |
979 ASSERT_THAT(mock_, testing::NotNull()); | 980 ASSERT_THAT(mock_, testing::NotNull()); |
980 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) | 981 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
981 .Times(testing::AnyNumber()); | 982 .Times(testing::AnyNumber()); |
982 EXPECT_CALL(*mock_, OnLoad(_, _)).Times(testing::AnyNumber()); | 983 EXPECT_CALL(*mock_, OnLoad(_, _)).Times(testing::AnyNumber()); |
983 | 984 |
984 std::string kTestMessage("Hello from gtest"); | 985 std::string kTestMessage("Hello from gtest"); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 | 1489 |
1489 // Allow some time for the popup to show up and close. | 1490 // Allow some time for the popup to show up and close. |
1490 PlatformThread::Sleep(sleep_timeout_ms()); | 1491 PlatformThread::Sleep(sleep_timeout_ms()); |
1491 | 1492 |
1492 std::wstring expected(L"string"); | 1493 std::wstring expected(L"string"); |
1493 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); | 1494 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); |
1494 std::wstring actual; | 1495 std::wstring actual; |
1495 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); | 1496 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); |
1496 ASSERT_EQ(expected, actual); | 1497 ASSERT_EQ(expected, actual); |
1497 } | 1498 } |
OLD | NEW |