Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" |
| 7 | 7 |
| 8 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 BrowserList::SetLastActive(browser()); | 229 BrowserList::SetLastActive(browser()); |
| 230 ASSERT_TRUE(BrowserList::GetLastActive()); | 230 ASSERT_TRUE(BrowserList::GetLastActive()); |
| 231 | 231 |
| 232 AddTestHandlers(); | 232 AddTestHandlers(); |
| 233 | 233 |
| 234 TestController::GetInstance()->set_use_delegate(true); | 234 TestController::GetInstance()->set_use_delegate(true); |
| 235 | 235 |
| 236 ui_test_utils::RunMessageLoop(); | 236 ui_test_utils::RunMessageLoop(); |
| 237 | 237 |
| 238 ASSERT_TRUE(TestController::GetInstance()->result()); | 238 ASSERT_TRUE(TestController::GetInstance()->result()); |
| 239 | |
| 240 // Close the dialog before finishing the test. | |
|
willchan no longer on Chromium
2011/08/26 11:47:15
While this will fix the test, which is a good thin
| |
| 241 EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_ESCAPE, | |
| 242 false, false, false, false)); | |
| 243 ui_test_utils::WaitForNotification(content::NOTIFICATION_TAB_CLOSED); | |
|
Paweł Hajdan Jr.
2011/08/26 21:52:26
Please use WindowedNotificationObserver to avoid a
Scott Byer
2011/08/27 19:28:04
Done. Thanks! That solved he Windows try bot issu
| |
| 239 } | 244 } |
| 240 | 245 |
| 241 #if defined(OS_CHROMEOS) | 246 #if defined(OS_CHROMEOS) |
| 242 // Disabled until the extern URL is live so that the Print menu item | 247 // Disabled until the extern URL is live so that the Print menu item |
| 243 // can be enabled for Chromium OS. | 248 // can be enabled for Chromium OS. |
| 244 IN_PROC_BROWSER_TEST_F(PrintDialogCloudTest, DISABLED_DialogGrabbed) { | 249 IN_PROC_BROWSER_TEST_F(PrintDialogCloudTest, DISABLED_DialogGrabbed) { |
| 245 BrowserList::SetLastActive(browser()); | 250 BrowserList::SetLastActive(browser()); |
| 246 ASSERT_TRUE(BrowserList::GetLastActive()); | 251 ASSERT_TRUE(BrowserList::GetLastActive()); |
| 247 | 252 |
| 248 AddTestHandlers(); | 253 AddTestHandlers(); |
| 249 | 254 |
| 250 // This goes back one step further for the Chrome OS case, to making | 255 // This goes back one step further for the Chrome OS case, to making |
| 251 // sure 'window.print()' gets to the right place. | 256 // sure 'window.print()' gets to the right place. |
| 252 ASSERT_TRUE(browser()->GetSelectedTabContents()); | 257 ASSERT_TRUE(browser()->GetSelectedTabContents()); |
| 253 ASSERT_TRUE(browser()->GetSelectedTabContents()->render_view_host()); | 258 ASSERT_TRUE(browser()->GetSelectedTabContents()->render_view_host()); |
| 254 | 259 |
| 255 string16 window_print = ASCIIToUTF16("window.print()"); | 260 string16 window_print = ASCIIToUTF16("window.print()"); |
| 256 browser()->GetSelectedTabContents()->render_view_host()-> | 261 browser()->GetSelectedTabContents()->render_view_host()-> |
| 257 ExecuteJavascriptInWebFrame(string16(), window_print); | 262 ExecuteJavascriptInWebFrame(string16(), window_print); |
| 258 | 263 |
| 259 ui_test_utils::RunMessageLoop(); | 264 ui_test_utils::RunMessageLoop(); |
| 260 | 265 |
| 261 ASSERT_TRUE(TestController::GetInstance()->result()); | 266 ASSERT_TRUE(TestController::GetInstance()->result()); |
| 262 } | 267 } |
| 263 #endif | 268 #endif |
| OLD | NEW |