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