| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 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/extensions/extension_test_api.h" |
| 6 #include "chrome/common/notification_service.h" |
| 7 |
| 8 namespace extension_test_api_functions { |
| 9 const char kPassFunction[] = "test.pass"; |
| 10 const char kFailFunction[] = "test.fail"; |
| 11 }; // namespace extension_test_api_functions |
| 12 |
| 13 bool ExtensionTestPassFunction::RunImpl() { |
| 14 NotificationService::current()->Notify( |
| 15 NotificationType::EXTENSION_TEST_PASSED, |
| 16 Source<Profile>(dispatcher()->profile()), |
| 17 NotificationService::NoDetails()); |
| 18 return true; |
| 19 } |
| 20 |
| 21 bool ExtensionTestFailFunction::RunImpl() { |
| 22 std::string message; |
| 23 EXTENSION_FUNCTION_VALIDATE(args_->GetAsString(&message)); |
| 24 NotificationService::current()->Notify( |
| 25 NotificationType::EXTENSION_TEST_FAILED, |
| 26 Source<Profile>(dispatcher()->profile()), |
| 27 Details<std::string>(&message)); |
| 28 return true; |
| 29 } |
| OLD | NEW |