#include "base/command_line.h"
#include "base/memory/singleton.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/content_switches.h"
#include "extensions/browser/extension_function_dispatcher.h"
#include "extensions/browser/extension_system.h"
-#include "extensions/browser/quota_service.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/common/api/test.h"
namespace {
bool TestNotifyPassFunction::RunSafe() {
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_TEST_PASSED,
+ extensions::NOTIFICATION_EXTENSION_TEST_PASSED,
content::Source<content::BrowserContext>(dispatcher()->browser_context()),
content::NotificationService::NoDetails());
return true;
scoped_ptr<NotifyFail::Params> params(NotifyFail::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_TEST_FAILED,
+ extensions::NOTIFICATION_EXTENSION_TEST_FAILED,
content::Source<content::BrowserContext>(dispatcher()->browser_context()),
content::Details<std::string>(¶ms->message));
return true;
return true;
}
-TestResetQuotaFunction::~TestResetQuotaFunction() {}
-
-bool TestResetQuotaFunction::RunSafe() {
- QuotaService* quota =
- ExtensionSystem::Get(browser_context())->quota_service();
- quota->Purge();
- quota->violation_errors_.clear();
- return true;
-}
-
bool TestSendMessageFunction::RunAsync() {
scoped_ptr<PassMessage::Params> params(PassMessage::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
+ extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
content::Source<TestSendMessageFunction>(this),
content::Details<std::string>(¶ms->message));
return true;
SendResponse(true);
}
+void TestSendMessageFunction::ReplyWithError(const std::string& error) {
+ error_ = error;
+ SendResponse(false);
+}
+
// static
void TestGetConfigFunction::set_test_config_state(
base::DictionaryValue* value) {