| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/gfx/gdi_util.h" | 5 #include "app/gfx/gdi_util.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/simple_thread.h" | 8 #include "base/simple_thread.h" |
| 9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 WM_COMMAND, | 255 WM_COMMAND, |
| 256 print_button_id, | 256 print_button_id, |
| 257 reinterpret_cast<LPARAM>(GetDlgItem(dialog_window, print_button_id))); | 257 reinterpret_cast<LPARAM>(GetDlgItem(dialog_window, print_button_id))); |
| 258 return res == 0; | 258 return res == 0; |
| 259 } | 259 } |
| 260 | 260 |
| 261 // Dismiss the first dialog box owned by owner_process by "executing" the | 261 // Dismiss the first dialog box owned by owner_process by "executing" the |
| 262 // default button. | 262 // default button. |
| 263 class DismissTheWindow : public base::DelegateSimpleThread::Delegate { | 263 class DismissTheWindow : public base::DelegateSimpleThread::Delegate { |
| 264 public: | 264 public: |
| 265 DismissTheWindow(DWORD owner_process) | 265 explicit DismissTheWindow(DWORD owner_process) |
| 266 : owner_process_(owner_process) { | 266 : owner_process_(owner_process) { |
| 267 } | 267 } |
| 268 | 268 |
| 269 virtual void Run() { | 269 virtual void Run() { |
| 270 HWND dialog_window; | 270 HWND dialog_window; |
| 271 for (;;) { | 271 for (;;) { |
| 272 // First enumerate the windows. | 272 // First enumerate the windows. |
| 273 dialog_window = FindDialogWindow(owner_process_); | 273 dialog_window = FindDialogWindow(owner_process_); |
| 274 | 274 |
| 275 // Try to close it. | 275 // Try to close it. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 | 443 |
| 444 // Force a navigation elsewhere to verify that it's fine with it. | 444 // Force a navigation elsewhere to verify that it's fine with it. |
| 445 url = server->TestServerPage("files/printing/test1.html"); | 445 url = server->TestServerPage("files/printing/test1.html"); |
| 446 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, | 446 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, |
| 447 tab_proxy->NavigateToURL(url)); | 447 tab_proxy->NavigateToURL(url)); |
| 448 } | 448 } |
| 449 CloseBrowserAndServer(); | 449 CloseBrowserAndServer(); |
| 450 | 450 |
| 451 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; | 451 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; |
| 452 } | 452 } |
| OLD | NEW |