| 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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 EXPECT_TRUE(edit1->SetText(text_to_set1)); | 974 EXPECT_TRUE(edit1->SetText(text_to_set1)); |
| 975 EXPECT_TRUE(edit2->SetText(text_to_set2)); | 975 EXPECT_TRUE(edit2->SetText(text_to_set2)); |
| 976 EXPECT_TRUE(edit1->GetText(&actual_text1)); | 976 EXPECT_TRUE(edit1->GetText(&actual_text1)); |
| 977 EXPECT_TRUE(edit2->GetText(&actual_text2)); | 977 EXPECT_TRUE(edit2->GetText(&actual_text2)); |
| 978 EXPECT_EQ(text_to_set1, actual_text1); | 978 EXPECT_EQ(text_to_set1, actual_text1); |
| 979 EXPECT_EQ(text_to_set2, actual_text2); | 979 EXPECT_EQ(text_to_set2, actual_text2); |
| 980 } | 980 } |
| 981 | 981 |
| 982 #endif // defined(OS_WIN) || defined(OS_LINUX) | 982 #endif // defined(OS_WIN) || defined(OS_LINUX) |
| 983 | 983 |
| 984 // Not run on linux because of flakiness. http://crbug.com/19876 | 984 // So flaky, http://crbug.com/19876. Consult phajdan.jr before re-enabling. |
| 985 #if defined(OS_WIN) | 985 TEST_F(AutomationProxyVisibleTest, DISABLED_AutocompleteMatchesTest) { |
| 986 TEST_F(AutomationProxyVisibleTest, AutocompleteMatchesTest) { | |
| 987 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 986 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 988 ASSERT_TRUE(browser.get()); | 987 ASSERT_TRUE(browser.get()); |
| 989 scoped_refptr<AutocompleteEditProxy> edit( | 988 scoped_refptr<AutocompleteEditProxy> edit( |
| 990 browser->GetAutocompleteEdit()); | 989 browser->GetAutocompleteEdit()); |
| 991 ASSERT_TRUE(edit.get()); | 990 ASSERT_TRUE(edit.get()); |
| 992 EXPECT_TRUE(browser->ApplyAccelerator(IDC_FOCUS_LOCATION)); | 991 EXPECT_TRUE(browser->ApplyAccelerator(IDC_FOCUS_LOCATION)); |
| 993 EXPECT_TRUE(edit->is_valid()); | 992 EXPECT_TRUE(edit->is_valid()); |
| 994 EXPECT_TRUE(edit->SetText(L"Roflcopter")); | 993 EXPECT_TRUE(edit->SetText(L"Roflcopter")); |
| 995 EXPECT_TRUE(edit->WaitForQuery(30000)); | 994 EXPECT_TRUE(edit->WaitForQuery(30000)); |
| 996 bool query_in_progress; | 995 bool query_in_progress; |
| 997 EXPECT_TRUE(edit->IsQueryInProgress(&query_in_progress)); | 996 EXPECT_TRUE(edit->IsQueryInProgress(&query_in_progress)); |
| 998 EXPECT_FALSE(query_in_progress); | 997 EXPECT_FALSE(query_in_progress); |
| 999 std::vector<AutocompleteMatchData> matches; | 998 std::vector<AutocompleteMatchData> matches; |
| 1000 EXPECT_TRUE(edit->GetAutocompleteMatches(&matches)); | 999 EXPECT_TRUE(edit->GetAutocompleteMatches(&matches)); |
| 1001 EXPECT_FALSE(matches.empty()); | 1000 EXPECT_FALSE(matches.empty()); |
| 1002 } | 1001 } |
| 1003 #endif // defined(OS_WIN) | |
| 1004 | 1002 |
| 1005 // Disabled because flaky see bug #5314. | 1003 // Disabled because flaky see bug #5314. |
| 1006 TEST_F(AutomationProxyTest, DISABLED_AppModalDialogTest) { | 1004 TEST_F(AutomationProxyTest, DISABLED_AppModalDialogTest) { |
| 1007 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 1005 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 1008 ASSERT_TRUE(browser.get()); | 1006 ASSERT_TRUE(browser.get()); |
| 1009 scoped_refptr<TabProxy> tab(browser->GetTab(0)); | 1007 scoped_refptr<TabProxy> tab(browser->GetTab(0)); |
| 1010 ASSERT_TRUE(tab.get()); | 1008 ASSERT_TRUE(tab.get()); |
| 1011 | 1009 |
| 1012 bool modal_dialog_showing = false; | 1010 bool modal_dialog_showing = false; |
| 1013 MessageBoxFlags::DialogButton button = MessageBoxFlags::DIALOGBUTTON_NONE; | 1011 MessageBoxFlags::DialogButton button = MessageBoxFlags::DIALOGBUTTON_NONE; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 | 1110 |
| 1113 // Allow some time for the popup to show up and close. | 1111 // Allow some time for the popup to show up and close. |
| 1114 PlatformThread::Sleep(2000); | 1112 PlatformThread::Sleep(2000); |
| 1115 | 1113 |
| 1116 std::wstring expected(L"string"); | 1114 std::wstring expected(L"string"); |
| 1117 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); | 1115 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); |
| 1118 std::wstring actual; | 1116 std::wstring actual; |
| 1119 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); | 1117 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); |
| 1120 ASSERT_EQ(expected, actual); | 1118 ASSERT_EQ(expected, actual); |
| 1121 } | 1119 } |
| OLD | NEW |