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/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 OpenSingletonTabAndCancel) { | 326 OpenSingletonTabAndCancel) { |
327 AddMountPoint(downloads_dir_); | 327 AddMountPoint(downloads_dir_); |
328 | 328 |
329 gfx::NativeWindow owning_window = browser()->window()->GetNativeWindow(); | 329 gfx::NativeWindow owning_window = browser()->window()->GetNativeWindow(); |
330 | 330 |
331 ASSERT_NO_FATAL_FAILURE(OpenDialog(ui::SelectFileDialog::SELECT_OPEN_FILE, | 331 ASSERT_NO_FATAL_FAILURE(OpenDialog(ui::SelectFileDialog::SELECT_OPEN_FILE, |
332 base::FilePath(), owning_window, "")); | 332 base::FilePath(), owning_window, "")); |
333 | 333 |
334 // Open a singleton tab in background. | 334 // Open a singleton tab in background. |
335 chrome::NavigateParams p(browser(), GURL("http://www.google.com"), | 335 chrome::NavigateParams p(browser(), GURL("http://www.google.com"), |
336 content::PAGE_TRANSITION_LINK); | 336 ui::PAGE_TRANSITION_LINK); |
337 p.window_action = chrome::NavigateParams::SHOW_WINDOW; | 337 p.window_action = chrome::NavigateParams::SHOW_WINDOW; |
338 p.disposition = SINGLETON_TAB; | 338 p.disposition = SINGLETON_TAB; |
339 chrome::Navigate(&p); | 339 chrome::Navigate(&p); |
340 | 340 |
341 // Press cancel button. | 341 // Press 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()); |
(...skipping 15 matching lines...) Expand all Loading... |
362 ASSERT_FALSE(second_dialog_->IsRunning(owning_window)); | 362 ASSERT_FALSE(second_dialog_->IsRunning(owning_window)); |
363 | 363 |
364 // Click cancel button. | 364 // Click cancel button. |
365 CloseDialog(DIALOG_BTN_CANCEL, owning_window); | 365 CloseDialog(DIALOG_BTN_CANCEL, owning_window); |
366 | 366 |
367 // Listener should have been informed of the cancellation. | 367 // Listener should have been informed of the cancellation. |
368 ASSERT_FALSE(listener_->file_selected()); | 368 ASSERT_FALSE(listener_->file_selected()); |
369 ASSERT_TRUE(listener_->canceled()); | 369 ASSERT_TRUE(listener_->canceled()); |
370 ASSERT_EQ(this, listener_->params()); | 370 ASSERT_EQ(this, listener_->params()); |
371 } | 371 } |
OLD | NEW |