| 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
| 7 #include "chrome/browser/download/download_prefs.h" | 7 #include "chrome/browser/download/download_prefs.h" |
| 8 #include "chrome/browser/extensions/event_router.h" | 8 #include "chrome/browser/extensions/event_router.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_info_map.h" | 10 #include "chrome/browser/extensions/extension_info_map.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // onExecuteContentHandler event (and does not start a download). | 202 // onExecuteContentHandler event (and does not start a download). |
| 203 IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, Navigate) { | 203 IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, Navigate) { |
| 204 ASSERT_TRUE(LoadTestExtension()) << message_; | 204 ASSERT_TRUE(LoadTestExtension()) << message_; |
| 205 | 205 |
| 206 ResultCatcher catcher; | 206 ResultCatcher catcher; |
| 207 | 207 |
| 208 ui_test_utils::NavigateToURL(browser(), | 208 ui_test_utils::NavigateToURL(browser(), |
| 209 test_server_->GetURL("/doc_path.doc")); | 209 test_server_->GetURL("/doc_path.doc")); |
| 210 | 210 |
| 211 // Wait for the response from the test server. | 211 // Wait for the response from the test server. |
| 212 MessageLoop::current()->RunUntilIdle(); | 212 base::MessageLoop::current()->RunUntilIdle(); |
| 213 | 213 |
| 214 // There should be no downloads started by the navigation. | 214 // There should be no downloads started by the navigation. |
| 215 DownloadManager* download_manager = GetDownloadManager(); | 215 DownloadManager* download_manager = GetDownloadManager(); |
| 216 std::vector<DownloadItem*> downloads; | 216 std::vector<DownloadItem*> downloads; |
| 217 download_manager->GetAllDownloads(&downloads); | 217 download_manager->GetAllDownloads(&downloads); |
| 218 ASSERT_EQ(0u, downloads.size()); | 218 ASSERT_EQ(0u, downloads.size()); |
| 219 | 219 |
| 220 // The test extension should receive onExecuteContentHandler event with MIME | 220 // The test extension should receive onExecuteContentHandler event with MIME |
| 221 // type 'application/msword' (and call chrome.test.notifySuccess). | 221 // type 'application/msword' (and call chrome.test.notifySuccess). |
| 222 EXPECT_TRUE(catcher.GetNextResult()); | 222 EXPECT_TRUE(catcher.GetNextResult()); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // The test extension should not receive any events by now. Send it an event | 306 // The test extension should not receive any events by now. Send it an event |
| 307 // with MIME type "test/done", so it stops waiting for the events. (If there | 307 // with MIME type "test/done", so it stops waiting for the events. (If there |
| 308 // was an event with MIME type 'plain/text', |catcher.GetNextResult()| will | 308 // was an event with MIME type 'plain/text', |catcher.GetNextResult()| will |
| 309 // fail regardless of the sent event; chrome.test.notifySuccess will not be | 309 // fail regardless of the sent event; chrome.test.notifySuccess will not be |
| 310 // called by the extension). | 310 // called by the extension). |
| 311 SendDoneEvent(); | 311 SendDoneEvent(); |
| 312 EXPECT_TRUE(catcher.GetNextResult()); | 312 EXPECT_TRUE(catcher.GetNextResult()); |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace | 315 } // namespace |
| OLD | NEW |