| 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_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/macros.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/shell_dialogs/selected_file_info.h" | 10 #include "ui/shell_dialogs/selected_file_info.h" |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 const SelectFileDialogExtension::RoutingID kDefaultRoutingID = | 14 const SelectFileDialogExtension::RoutingID kDefaultRoutingID = |
| 14 SelectFileDialogExtension::RoutingID(); | 15 SelectFileDialogExtension::RoutingID(); |
| 15 | 16 |
| 16 } // namespace | 17 } // namespace |
| 17 | 18 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 116 |
| 116 TEST_F(SelectFileDialogExtensionTest, SelfDeleting) { | 117 TEST_F(SelectFileDialogExtensionTest, SelfDeleting) { |
| 117 SelfDeletingClient* client = new SelfDeletingClient(); | 118 SelfDeletingClient* client = new SelfDeletingClient(); |
| 118 // Ensure we don't crash or trip an Address Sanitizer warning about | 119 // Ensure we don't crash or trip an Address Sanitizer warning about |
| 119 // use-after-free. | 120 // use-after-free. |
| 120 ui::SelectedFileInfo file_info; | 121 ui::SelectedFileInfo file_info; |
| 121 SelectFileDialogExtension::OnFileSelected(kDefaultRoutingID, file_info, 0); | 122 SelectFileDialogExtension::OnFileSelected(kDefaultRoutingID, file_info, 0); |
| 122 // Simulate closing the dialog so the listener gets invoked. | 123 // Simulate closing the dialog so the listener gets invoked. |
| 123 client->dialog()->ExtensionDialogClosing(NULL); | 124 client->dialog()->ExtensionDialogClosing(NULL); |
| 124 } | 125 } |
| OLD | NEW |