| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 #include "chrome/browser/tab_contents/tab_contents.h" | 6 #include "chrome/browser/tab_contents/tab_contents.h" |
| 7 #include "chrome/browser/download/download_manager.h" | 7 #include "chrome/browser/download/download_manager.h" |
| 8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
| 9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 ui_test_utils::NavigateToURL(browser(), downloads_url); | 42 ui_test_utils::NavigateToURL(browser(), downloads_url); |
| 43 ui_test_utils::NavigateToURL(browser(), zip_url); | 43 ui_test_utils::NavigateToURL(browser(), zip_url); |
| 44 ui_test_utils::WaitForDownloadCount( | 44 ui_test_utils::WaitForDownloadCount( |
| 45 browser()->profile()->GetDownloadManager(), 1); | 45 browser()->profile()->GetDownloadManager(), 1); |
| 46 ui_test_utils::NavigateToURL(browser(), extensions_url); | 46 ui_test_utils::NavigateToURL(browser(), extensions_url); |
| 47 | 47 |
| 48 TabContents *contents = browser()->GetSelectedTabContents(); | 48 TabContents *contents = browser()->GetSelectedTabContents(); |
| 49 ASSERT_TRUE(contents); | 49 ASSERT_TRUE(contents); |
| 50 bool domui_responded = false; | 50 bool domui_responded = false; |
| 51 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 51 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 52 contents, | 52 contents->render_view_host(), |
| 53 L"", | 53 L"", |
| 54 L"window.domAutomationController.send(window.domui_responded_);", | 54 L"window.domAutomationController.send(window.domui_responded_);", |
| 55 &domui_responded)); | 55 &domui_responded)); |
| 56 EXPECT_TRUE(domui_responded); | 56 EXPECT_TRUE(domui_responded); |
| 57 } | 57 } |
| 58 | 58 |
| 59 class BrowserClosedObserver : public NotificationObserver { | 59 class BrowserClosedObserver : public NotificationObserver { |
| 60 public: | 60 public: |
| 61 explicit BrowserClosedObserver(Browser* browser) { | 61 explicit BrowserClosedObserver(Browser* browser) { |
| 62 registrar_.Add(this, NotificationType::BROWSER_CLOSED, | 62 registrar_.Add(this, NotificationType::BROWSER_CLOSED, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 &result)); | 103 &result)); |
| 104 EXPECT_TRUE(result); | 104 EXPECT_TRUE(result); |
| 105 ui_test_utils::NavigateToURL(browser(), zip_url); | 105 ui_test_utils::NavigateToURL(browser(), zip_url); |
| 106 | 106 |
| 107 ui_test_utils::WaitForDownloadCount( | 107 ui_test_utils::WaitForDownloadCount( |
| 108 browser()->profile()->GetDownloadManager(), 1); | 108 browser()->profile()->GetDownloadManager(), 1); |
| 109 | 109 |
| 110 browser()->CloseWindow(); | 110 browser()->CloseWindow(); |
| 111 BrowserClosedObserver wait_for_close(browser()); | 111 BrowserClosedObserver wait_for_close(browser()); |
| 112 } | 112 } |
| OLD | NEW |