OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/launcher_search_provider/test_util.h" |
| 6 |
| 7 #include "extensions/browser/event_router.h" |
| 8 #include "extensions/common/api/test.h" |
| 9 |
| 10 namespace chromeos { |
| 11 namespace launcher_search_provider { |
| 12 |
| 13 void TestUtil::SendMessageToTestExtension(Profile* profile, |
| 14 const std::string& message) { |
| 15 namespace OnMessage = extensions::core_api::test::OnMessage; |
| 16 |
| 17 // TODO(yawano): Return here if it's not in the test process. Do this in the |
| 18 // next patch set. |
| 19 |
| 20 // Sends message to test extension. |
| 21 OnMessage::Info info; |
| 22 info.data = message; |
| 23 info.last_message = true; |
| 24 extensions::EventRouter::Get(profile)->BroadcastEvent(make_scoped_ptr( |
| 25 new extensions::Event(OnMessage::kEventName, OnMessage::Create(info)))); |
| 26 } |
| 27 |
| 28 } // namespace launcher_search_provider |
| 29 } // namespace chromeos |
OLD | NEW |