| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/task.h" | |
| 6 #include "base/path_service.h" | 5 #include "base/path_service.h" |
| 7 #include "chrome/browser/dom_ui/dom_ui.h" | 6 #include "chrome/browser/dom_ui/dom_ui.h" |
| 8 #include "chrome/browser/tab_contents/navigation_controller.h" | 7 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/browser/views/html_dialog_view.h" | 9 #include "chrome/browser/views/html_dialog_view.h" |
| 11 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| 12 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
| 13 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
| 14 #include "chrome/test/in_process_browser_test.h" | 13 #include "chrome/test/in_process_browser_test.h" |
| 15 #include "chrome/test/ui_test_utils.h" | 14 #include "chrome/test/ui_test_utils.h" |
| 16 #include "net/test/test_server.h" | 15 #include "net/test/test_server.h" |
| 17 | 16 |
| 18 namespace { | 17 namespace { |
| 19 | 18 |
| 20 typedef DOMElementProxy::By By; | 19 typedef DOMElementProxy::By By; |
| 21 | 20 |
| 22 class FileBrowseBrowserTest : public InProcessBrowserTest { | 21 class FileBrowseBrowserTest : public InProcessBrowserTest { |
| 23 public: | 22 public: |
| 24 FileBrowseBrowserTest() { | 23 FileBrowseBrowserTest() { |
| 25 EnableDOMAutomation(); | 24 EnableDOMAutomation(); |
| 26 } | 25 } |
| 27 }; | 26 }; |
| 28 | 27 |
| 29 class FileBrowseUiObserver : public NotificationObserver { | 28 class FileBrowseUiObserver : public NotificationObserver { |
| 30 public: | 29 public: |
| 31 FileBrowseUiObserver() : file_browse_tab_(NULL), is_waiting_(false) { | 30 FileBrowseUiObserver() : file_browse_tab_(NULL), is_waiting_(false) { |
| 32 registrar_.Add(this, NotificationType::LOAD_STOP, | 31 registrar_.Add(this, NotificationType::LOAD_STOP, |
| 33 NotificationService::AllSources()); | 32 NotificationService::AllSources()); |
| 34 registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED, | 33 registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED, |
| 35 NotificationService::AllSources()); | 34 NotificationService::AllSources()); |
| 36 } | 35 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 observer.WaitForFileBrowseLoad(); | 120 observer.WaitForFileBrowseLoad(); |
| 122 DOMUI* file_browser_ui = observer.file_browse_ui(); | 121 DOMUI* file_browser_ui = observer.file_browse_ui(); |
| 123 ASSERT_TRUE(file_browser_ui); | 122 ASSERT_TRUE(file_browser_ui); |
| 124 | 123 |
| 125 file_browser_ui->CallJavascriptFunction(L"dialogCancelClick"); | 124 file_browser_ui->CallJavascriptFunction(L"dialogCancelClick"); |
| 126 | 125 |
| 127 observer.WaitForFileBrowseClose(); | 126 observer.WaitForFileBrowseClose(); |
| 128 } | 127 } |
| 129 | 128 |
| 130 } // namespace | 129 } // namespace |
| OLD | NEW |