Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: chrome/browser/extensions/extension_test_api.cc

Issue 174633: Add browser tests for extensions tab API. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/extension_test_api.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 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 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 "chrome/browser/extensions/extension_test_api.h" 5 #include "chrome/browser/extensions/extension_test_api.h"
6 #include "chrome/common/notification_service.h" 6 #include "chrome/common/notification_service.h"
7 7
8 namespace extension_test_api_functions { 8 namespace extension_test_api_functions {
9 const char kPassFunction[] = "test.notifyPass"; 9 const char kPassFunction[] = "test.notifyPass";
10 const char kFailFunction[] = "test.notifyFail"; 10 const char kFailFunction[] = "test.notifyFail";
11 const char kLogFunction[] = "test.log";
11 }; // namespace extension_test_api_functions 12 }; // namespace extension_test_api_functions
12 13
13 bool ExtensionTestPassFunction::RunImpl() { 14 bool ExtensionTestPassFunction::RunImpl() {
14 NotificationService::current()->Notify( 15 NotificationService::current()->Notify(
15 NotificationType::EXTENSION_TEST_PASSED, 16 NotificationType::EXTENSION_TEST_PASSED,
16 Source<Profile>(dispatcher()->profile()), 17 Source<Profile>(dispatcher()->profile()),
17 NotificationService::NoDetails()); 18 NotificationService::NoDetails());
18 return true; 19 return true;
19 } 20 }
20 21
21 bool ExtensionTestFailFunction::RunImpl() { 22 bool ExtensionTestFailFunction::RunImpl() {
22 std::string message; 23 std::string message;
23 EXTENSION_FUNCTION_VALIDATE(args_->GetAsString(&message)); 24 EXTENSION_FUNCTION_VALIDATE(args_->GetAsString(&message));
24 NotificationService::current()->Notify( 25 NotificationService::current()->Notify(
25 NotificationType::EXTENSION_TEST_FAILED, 26 NotificationType::EXTENSION_TEST_FAILED,
26 Source<Profile>(dispatcher()->profile()), 27 Source<Profile>(dispatcher()->profile()),
27 Details<std::string>(&message)); 28 Details<std::string>(&message));
28 return true; 29 return true;
29 } 30 }
31
32 bool ExtensionTestLogFunction::RunImpl() {
33 std::string message;
34 EXTENSION_FUNCTION_VALIDATE(args_->GetAsString(&message));
35 printf("%s\n", message.c_str());
36 LOG(INFO) << message;
37 return true;
38 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_test_api.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698