OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/test/test_api.h" | 5 #include "extensions/browser/api/test/test_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 TestResetQuotaFunction::~TestResetQuotaFunction() {} | 80 TestResetQuotaFunction::~TestResetQuotaFunction() {} |
81 | 81 |
82 bool TestResetQuotaFunction::RunSafe() { | 82 bool TestResetQuotaFunction::RunSafe() { |
83 QuotaService* quota = | 83 QuotaService* quota = |
84 ExtensionSystem::Get(browser_context())->quota_service(); | 84 ExtensionSystem::Get(browser_context())->quota_service(); |
85 quota->Purge(); | 85 quota->Purge(); |
86 quota->violation_errors_.clear(); | 86 quota->violation_errors_.clear(); |
87 return true; | 87 return true; |
88 } | 88 } |
89 | 89 |
90 bool TestSendMessageFunction::RunImpl() { | 90 bool TestSendMessageFunction::RunAsync() { |
91 scoped_ptr<PassMessage::Params> params(PassMessage::Params::Create(*args_)); | 91 scoped_ptr<PassMessage::Params> params(PassMessage::Params::Create(*args_)); |
92 EXTENSION_FUNCTION_VALIDATE(params.get()); | 92 EXTENSION_FUNCTION_VALIDATE(params.get()); |
93 content::NotificationService::current()->Notify( | 93 content::NotificationService::current()->Notify( |
94 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, | 94 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, |
95 content::Source<TestSendMessageFunction>(this), | 95 content::Source<TestSendMessageFunction>(this), |
96 content::Details<std::string>(¶ms->message)); | 96 content::Details<std::string>(¶ms->message)); |
97 return true; | 97 return true; |
98 } | 98 } |
99 | 99 |
100 TestSendMessageFunction::~TestSendMessageFunction() {} | 100 TestSendMessageFunction::~TestSendMessageFunction() {} |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} | 137 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} |
138 | 138 |
139 bool TestWaitForRoundTripFunction::RunSafe() { | 139 bool TestWaitForRoundTripFunction::RunSafe() { |
140 scoped_ptr<WaitForRoundTrip::Params> params( | 140 scoped_ptr<WaitForRoundTrip::Params> params( |
141 WaitForRoundTrip::Params::Create(*args_)); | 141 WaitForRoundTrip::Params::Create(*args_)); |
142 SetResult(new base::StringValue(params->message)); | 142 SetResult(new base::StringValue(params->message)); |
143 return true; | 143 return true; |
144 } | 144 } |
145 | 145 |
146 } // namespace extensions | 146 } // namespace extensions |
OLD | NEW |