Commit ec57ccfd authored by robliao@chromium.org's avatar robliao@chromium.org

Suppress Errors for chrome.alarm.get

Removed the error signalling to prevent log spam from the runtime.lastError
checks for non-existent alarms.

BUG=367136

Review URL: https://codereview.chromium.org/258793006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266352 0039d316-1c4b-4281-b951-d872f2087c98
parent 032c6a30
...@@ -19,7 +19,6 @@ namespace extensions { ...@@ -19,7 +19,6 @@ namespace extensions {
namespace { namespace {
const char kDefaultAlarmName[] = ""; const char kDefaultAlarmName[] = "";
const char kAlarmNotFound[] = "No alarm named '*' exists.";
const char kBothRelativeAndAbsoluteTime[] = const char kBothRelativeAndAbsoluteTime[] =
"Cannot set both when and delayInMinutes."; "Cannot set both when and delayInMinutes.";
const char kNoScheduledTime[] = const char kNoScheduledTime[] =
...@@ -147,11 +146,8 @@ void AlarmsGetFunction::Callback( ...@@ -147,11 +146,8 @@ void AlarmsGetFunction::Callback(
const std::string& name, extensions::Alarm* alarm) { const std::string& name, extensions::Alarm* alarm) {
if (alarm) { if (alarm) {
results_ = alarms::Get::Results::Create(*alarm->js_alarm); results_ = alarms::Get::Results::Create(*alarm->js_alarm);
SendResponse(true);
} else {
error_ = ErrorUtils::FormatErrorMessage(kAlarmNotFound, name);
SendResponse(false);
} }
SendResponse(true);
} }
bool AlarmsGetAllFunction::RunImpl() { bool AlarmsGetAllFunction::RunImpl() {
......
...@@ -323,9 +323,9 @@ TEST_F(ExtensionAlarmsTest, Get) { ...@@ -323,9 +323,9 @@ TEST_F(ExtensionAlarmsTest, Get) {
// Get a non-existent one. // Get a non-existent one.
{ {
std::string error = RunFunctionAndReturnError( scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDictionary(
new AlarmsGetFunction(), "[\"nobody\"]"); new AlarmsGetFunction(), "[\"nobody\"]"));
EXPECT_FALSE(error.empty()); ASSERT_FALSE(result.get());
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment