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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/download/download_prefs.h" | 8 #include "chrome/browser/download/download_prefs.h" |
9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // has already been called). | 174 // has already been called). |
175 void SendDoneEvent() { | 175 void SendDoneEvent() { |
176 streams_private::StreamInfo info; | 176 streams_private::StreamInfo info; |
177 info.mime_type = "test/done"; | 177 info.mime_type = "test/done"; |
178 info.original_url = "http://foo"; | 178 info.original_url = "http://foo"; |
179 info.stream_url = "blob://bar"; | 179 info.stream_url = "blob://bar"; |
180 info.tab_id = 10; | 180 info.tab_id = 10; |
181 info.expected_content_size = 20; | 181 info.expected_content_size = 20; |
182 | 182 |
183 scoped_ptr<Event> event( | 183 scoped_ptr<Event> event( |
184 new Event(streams_private::OnExecuteMimeTypeHandler::kEventName, | 184 new Event(extensions::events::UNKNOWN, |
| 185 streams_private::OnExecuteMimeTypeHandler::kEventName, |
185 streams_private::OnExecuteMimeTypeHandler::Create(info))); | 186 streams_private::OnExecuteMimeTypeHandler::Create(info))); |
186 | 187 |
187 extensions::EventRouter::Get(browser()->profile()) | 188 extensions::EventRouter::Get(browser()->profile()) |
188 ->DispatchEventToExtension(test_extension_id_, event.Pass()); | 189 ->DispatchEventToExtension(test_extension_id_, event.Pass()); |
189 } | 190 } |
190 | 191 |
191 // Loads the test extension and set's up its file_browser_handler to handle | 192 // Loads the test extension and set's up its file_browser_handler to handle |
192 // 'application/msword' and 'text/plain' MIME types. | 193 // 'application/msword' and 'text/plain' MIME types. |
193 // The extension will notify success when it detects an event with the MIME | 194 // The extension will notify success when it detects an event with the MIME |
194 // type 'application/msword' and notify fail when it detects an event with the | 195 // type 'application/msword' and notify fail when it detects an event with the |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 base::MessageLoop::current()->RunUntilIdle(); | 481 base::MessageLoop::current()->RunUntilIdle(); |
481 EXPECT_TRUE(catcher.GetNextResult()); | 482 EXPECT_TRUE(catcher.GetNextResult()); |
482 | 483 |
483 ui_test_utils::NavigateToURL(browser(), | 484 ui_test_utils::NavigateToURL(browser(), |
484 test_server_->GetURL("/abort.rtf")); | 485 test_server_->GetURL("/abort.rtf")); |
485 base::MessageLoop::current()->RunUntilIdle(); | 486 base::MessageLoop::current()->RunUntilIdle(); |
486 EXPECT_TRUE(catcher.GetNextResult()); | 487 EXPECT_TRUE(catcher.GetNextResult()); |
487 } | 488 } |
488 | 489 |
489 } // namespace | 490 } // namespace |
OLD | NEW |