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/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/message_box_flags.h" | 9 #include "app/message_box_flags.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 QUIT_LOOP_SOON(&loop, 50))); | 965 QUIT_LOOP_SOON(&loop, 50))); |
966 | 966 |
967 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); | 967 EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); |
968 | 968 |
969 tab = mock_->CreateTabWithUrl(GURL(content)); | 969 tab = mock_->CreateTabWithUrl(GURL(content)); |
970 loop.RunFor(action_max_timeout_ms()); | 970 loop.RunFor(action_max_timeout_ms()); |
971 } | 971 } |
972 | 972 |
973 TEST_F(ExternalTabUITest, FLAKY_PostMessageTarget) { | 973 TEST_F(ExternalTabUITest, FLAKY_PostMessageTarget) { |
974 const wchar_t kDocRoot[] = L"chrome/test/data/external_tab"; | 974 const wchar_t kDocRoot[] = L"chrome/test/data/external_tab"; |
975 scoped_refptr<HTTPTestServer> server( | 975 scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); |
976 HTTPTestServer::CreateServer(kDocRoot, NULL)); | |
977 ASSERT_THAT(server.get(), testing::NotNull()); | 976 ASSERT_THAT(server.get(), testing::NotNull()); |
978 | 977 |
979 scoped_refptr<TabProxy> tab; | 978 scoped_refptr<TabProxy> tab; |
980 TimedMessageLoopRunner loop(MessageLoop::current()); | 979 TimedMessageLoopRunner loop(MessageLoop::current()); |
981 ASSERT_THAT(mock_, testing::NotNull()); | 980 ASSERT_THAT(mock_, testing::NotNull()); |
982 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) | 981 EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
983 .Times(testing::AnyNumber()); | 982 .Times(testing::AnyNumber()); |
984 EXPECT_CALL(*mock_, OnLoad(_, _)).Times(testing::AnyNumber()); | 983 EXPECT_CALL(*mock_, OnLoad(_, _)).Times(testing::AnyNumber()); |
985 | 984 |
986 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... |
1490 | 1489 |
1491 // Allow some time for the popup to show up and close. | 1490 // Allow some time for the popup to show up and close. |
1492 PlatformThread::Sleep(sleep_timeout_ms()); | 1491 PlatformThread::Sleep(sleep_timeout_ms()); |
1493 | 1492 |
1494 std::wstring expected(L"string"); | 1493 std::wstring expected(L"string"); |
1495 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); | 1494 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); |
1496 std::wstring actual; | 1495 std::wstring actual; |
1497 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); | 1496 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); |
1498 ASSERT_EQ(expected, actual); | 1497 ASSERT_EQ(expected, actual); |
1499 } | 1498 } |
OLD | NEW |