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