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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/gfx/native_widget_types.h" | 7 #include "base/gfx/native_widget_types.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/app/chrome_dll_resource.h" | 11 #include "chrome/app/chrome_dll_resource.h" |
| 12 #include "chrome/common/chrome_switches.h" |
12 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
13 #include "chrome/common/platform_util.h" | 14 #include "chrome/common/platform_util.h" |
14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
15 #include "chrome/test/automation/browser_proxy.h" | 16 #include "chrome/test/automation/browser_proxy.h" |
16 #include "chrome/test/automation/tab_proxy.h" | 17 #include "chrome/test/automation/tab_proxy.h" |
17 #include "chrome/test/automation/window_proxy.h" | 18 #include "chrome/test/automation/window_proxy.h" |
18 #include "chrome/test/ui/ui_test.h" | 19 #include "chrome/test/ui/ui_test.h" |
19 #include "net/base/net_util.h" | 20 #include "net/base/net_util.h" |
20 #include "net/url_request/url_request_unittest.h" | 21 #include "net/url_request/url_request_unittest.h" |
21 #include "grit/chromium_strings.h" | 22 #include "grit/chromium_strings.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // Success, bail out. | 318 // Success, bail out. |
318 break; | 319 break; |
319 } | 320 } |
320 } | 321 } |
321 | 322 |
322 if (i == 10) | 323 if (i == 10) |
323 FAIL() << "failed to get error page title"; | 324 FAIL() << "failed to get error page title"; |
324 } | 325 } |
325 #endif | 326 #endif |
326 | 327 |
| 328 #if defined(OS_WIN) // only works on Windows for now: http:://crbug.com/15891 |
| 329 class ShowModalDialogTest : public UITest { |
| 330 public: |
| 331 ShowModalDialogTest() { |
| 332 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); |
| 333 } |
| 334 }; |
| 335 |
| 336 TEST_F(ShowModalDialogTest, BasicTest) { |
| 337 FilePath test_file(test_data_directory_); |
| 338 test_file = test_file.AppendASCII("showmodaldialog.html"); |
| 339 NavigateToURL(net::FilePathToFileURL(test_file)); |
| 340 |
| 341 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, action_timeout_ms())); |
| 342 |
| 343 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(1); |
| 344 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); |
| 345 |
| 346 std::wstring title; |
| 347 ASSERT_TRUE(tab->GetTabTitle(&title)); |
| 348 ASSERT_EQ(title, L"ModalDialogTitle"); |
| 349 } |
| 350 #endif |
| 351 |
327 } // namespace | 352 } // namespace |
OLD | NEW |