| 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 "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 IN_PROC_BROWSER_TEST_F(SelectFileDialogExtensionBrowserTest, | 304 IN_PROC_BROWSER_TEST_F(SelectFileDialogExtensionBrowserTest, |
| 305 OpenSingletonTabAndCancel) { | 305 OpenSingletonTabAndCancel) { |
| 306 AddMountPoint(downloads_dir_); | 306 AddMountPoint(downloads_dir_); |
| 307 | 307 |
| 308 gfx::NativeWindow owning_window = browser()->window()->GetNativeWindow(); | 308 gfx::NativeWindow owning_window = browser()->window()->GetNativeWindow(); |
| 309 | 309 |
| 310 OpenDialog(SelectFileDialog::SELECT_OPEN_FILE, FilePath(), owning_window, ""); | 310 OpenDialog(SelectFileDialog::SELECT_OPEN_FILE, FilePath(), owning_window, ""); |
| 311 | 311 |
| 312 // Open a singleton tab in background. | 312 // Open a singleton tab in background. |
| 313 browser::NavigateParams p(browser(), GURL("www.google.com"), | 313 browser::NavigateParams p(browser(), GURL("http://www.google.com"), |
| 314 content::PAGE_TRANSITION_LINK); | 314 content::PAGE_TRANSITION_LINK); |
| 315 p.window_action = browser::NavigateParams::SHOW_WINDOW; | 315 p.window_action = browser::NavigateParams::SHOW_WINDOW; |
| 316 p.disposition = SINGLETON_TAB; | 316 p.disposition = SINGLETON_TAB; |
| 317 browser::Navigate(&p); | 317 browser::Navigate(&p); |
| 318 | 318 |
| 319 // Press cancel button. | 319 // Press cancel button. |
| 320 CloseDialog(DIALOG_BTN_CANCEL, owning_window); | 320 CloseDialog(DIALOG_BTN_CANCEL, owning_window); |
| 321 | 321 |
| 322 // Listener should have been informed of the cancellation. | 322 // Listener should have been informed of the cancellation. |
| 323 ASSERT_FALSE(listener_->file_selected()); | 323 ASSERT_FALSE(listener_->file_selected()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 339 ASSERT_FALSE(second_dialog_->IsRunning(owning_window)); | 339 ASSERT_FALSE(second_dialog_->IsRunning(owning_window)); |
| 340 | 340 |
| 341 // Click cancel button. | 341 // Click cancel button. |
| 342 CloseDialog(DIALOG_BTN_CANCEL, owning_window); | 342 CloseDialog(DIALOG_BTN_CANCEL, owning_window); |
| 343 | 343 |
| 344 // Listener should have been informed of the cancellation. | 344 // Listener should have been informed of the cancellation. |
| 345 ASSERT_FALSE(listener_->file_selected()); | 345 ASSERT_FALSE(listener_->file_selected()); |
| 346 ASSERT_TRUE(listener_->canceled()); | 346 ASSERT_TRUE(listener_->canceled()); |
| 347 ASSERT_EQ(this, listener_->params()); | 347 ASSERT_EQ(this, listener_->params()); |
| 348 } | 348 } |
| OLD | NEW |