| 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 "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/gfx/native_widget_types.h" | 6 #include "base/gfx/native_widget_types.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 #endif | 205 #endif |
| 206 | 206 |
| 207 #if defined(OS_WIN) // only works on Windows for now: http:://crbug.com/15891 | 207 #if defined(OS_WIN) // only works on Windows for now: http:://crbug.com/15891 |
| 208 class ShowModalDialogTest : public UITest { | 208 class ShowModalDialogTest : public UITest { |
| 209 public: | 209 public: |
| 210 ShowModalDialogTest() { | 210 ShowModalDialogTest() { |
| 211 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); | 211 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); |
| 212 } | 212 } |
| 213 }; | 213 }; |
| 214 | 214 |
| 215 TEST_F(ShowModalDialogTest, BasicTest) { | 215 // So flaky, http://crbug.com/17806. Do *not* re-enable without a real fix. |
| 216 // Increasing timeouts is not a fix. |
| 217 TEST_F(ShowModalDialogTest, DISABLED_BasicTest) { |
| 216 // Test that a modal dialog is shown. | 218 // Test that a modal dialog is shown. |
| 217 FilePath test_file(test_data_directory_); | 219 FilePath test_file(test_data_directory_); |
| 218 test_file = test_file.AppendASCII("showmodaldialog.html"); | 220 test_file = test_file.AppendASCII("showmodaldialog.html"); |
| 219 NavigateToURL(net::FilePathToFileURL(test_file)); | 221 NavigateToURL(net::FilePathToFileURL(test_file)); |
| 220 | 222 |
| 221 ASSERT_TRUE(automation()->WaitForWindowCountToBecome( | 223 ASSERT_TRUE(automation()->WaitForWindowCountToBecome( |
| 222 2, action_max_timeout_ms())); | 224 2, action_max_timeout_ms())); |
| 223 | 225 |
| 224 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(1); | 226 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(1); |
| 225 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); | 227 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); |
| 226 ASSERT_TRUE(tab.get()); | 228 ASSERT_TRUE(tab.get()); |
| 227 | 229 |
| 228 std::wstring title; | 230 std::wstring title; |
| 229 ASSERT_TRUE(tab->GetTabTitle(&title)); | 231 ASSERT_TRUE(tab->GetTabTitle(&title)); |
| 230 ASSERT_EQ(title, L"ModalDialogTitle"); | 232 ASSERT_EQ(title, L"ModalDialogTitle"); |
| 231 | 233 |
| 232 // Test that window.close() works. Since we don't have a way of executing a | 234 // Test that window.close() works. Since we don't have a way of executing a |
| 233 // JS function on the page through TabProxy, reload it and use an unload | 235 // JS function on the page through TabProxy, reload it and use an unload |
| 234 // handler that closes the page. | 236 // handler that closes the page. |
| 235 ASSERT_EQ(tab->Reload(), AUTOMATION_MSG_NAVIGATION_SUCCESS); | 237 ASSERT_EQ(tab->Reload(), AUTOMATION_MSG_NAVIGATION_SUCCESS); |
| 236 ASSERT_TRUE(automation()->WaitForWindowCountToBecome( | 238 ASSERT_TRUE(automation()->WaitForWindowCountToBecome( |
| 237 1, action_max_timeout_ms())); | 239 1, action_max_timeout_ms())); |
| 238 } | 240 } |
| 239 #endif | 241 #endif |
| 240 | 242 |
| 241 } // namespace | 243 } // namespace |
| OLD | NEW |