Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / extensions / browser / api / test / test_api.cc
index 87252b7..4faaa03 100644 (file)
@@ -8,12 +8,11 @@
 
 #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 {
@@ -50,7 +49,7 @@ TestNotifyPassFunction::~TestNotifyPassFunction() {}
 
 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;
@@ -62,7 +61,7 @@ bool TestNotifyFailFunction::RunSafe() {
   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>(&params->message));
   return true;
@@ -77,21 +76,11 @@ bool TestLogFunction::RunSafe() {
   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>(&params->message));
   return true;
@@ -104,6 +93,11 @@ void TestSendMessageFunction::Reply(const std::string& message) {
   SendResponse(true);
 }
 
+void TestSendMessageFunction::ReplyWithError(const std::string& error) {
+  error_ = error;
+  SendResponse(false);
+}
+
 // static
 void TestGetConfigFunction::set_test_config_state(
     base::DictionaryValue* value) {