| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/select_file_dialog_extension.h" | 5 #include "chrome/browser/ui/views/select_file_dialog_extension.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 gfx::NativeWindow owning_window = browser()->window()->GetNativeWindow(); | 360 gfx::NativeWindow owning_window = browser()->window()->GetNativeWindow(); |
| 361 | 361 |
| 362 ASSERT_NO_FATAL_FAILURE(OpenDialog(ui::SelectFileDialog::SELECT_OPEN_FILE, | 362 ASSERT_NO_FATAL_FAILURE(OpenDialog(ui::SelectFileDialog::SELECT_OPEN_FILE, |
| 363 base::FilePath(), owning_window, "")); | 363 base::FilePath(), owning_window, "")); |
| 364 | 364 |
| 365 // Open a singleton tab in background. | 365 // Open a singleton tab in background. |
| 366 chrome::NavigateParams p(browser(), GURL("http://www.google.com"), | 366 chrome::NavigateParams p(browser(), GURL("http://www.google.com"), |
| 367 ui::PAGE_TRANSITION_LINK); | 367 ui::PAGE_TRANSITION_LINK); |
| 368 p.window_action = chrome::NavigateParams::SHOW_WINDOW; | 368 p.window_action = chrome::NavigateParams::SHOW_WINDOW; |
| 369 p.disposition = SINGLETON_TAB; | 369 p.disposition = WindowOpenDisposition::SINGLETON_TAB; |
| 370 chrome::Navigate(&p); | 370 chrome::Navigate(&p); |
| 371 | 371 |
| 372 // Press cancel button. | 372 // Press cancel button. |
| 373 CloseDialog(DIALOG_BTN_CANCEL, owning_window); | 373 CloseDialog(DIALOG_BTN_CANCEL, owning_window); |
| 374 | 374 |
| 375 // Listener should have been informed of the cancellation. | 375 // Listener should have been informed of the cancellation. |
| 376 ASSERT_FALSE(listener_->file_selected()); | 376 ASSERT_FALSE(listener_->file_selected()); |
| 377 ASSERT_TRUE(listener_->canceled()); | 377 ASSERT_TRUE(listener_->canceled()); |
| 378 ASSERT_EQ(this, listener_->params()); | 378 ASSERT_EQ(this, listener_->params()); |
| 379 } | 379 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 399 ASSERT_FALSE(second_dialog_->IsRunning(owning_window)); | 399 ASSERT_FALSE(second_dialog_->IsRunning(owning_window)); |
| 400 | 400 |
| 401 // Click cancel button. | 401 // Click cancel button. |
| 402 CloseDialog(DIALOG_BTN_CANCEL, owning_window); | 402 CloseDialog(DIALOG_BTN_CANCEL, owning_window); |
| 403 | 403 |
| 404 // Listener should have been informed of the cancellation. | 404 // Listener should have been informed of the cancellation. |
| 405 ASSERT_FALSE(listener_->file_selected()); | 405 ASSERT_FALSE(listener_->file_selected()); |
| 406 ASSERT_TRUE(listener_->canceled()); | 406 ASSERT_TRUE(listener_->canceled()); |
| 407 ASSERT_EQ(this, listener_->params()); | 407 ASSERT_EQ(this, listener_->params()); |
| 408 } | 408 } |
| OLD | NEW |