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

Unified Diff: chrome/test/webdriver/webdriver_logging.cc

Issue 9016024: Add option for not adding '.0' to the end of doubles that have no fractional (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/webdriver/commands/response.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/webdriver_logging.cc
diff --git a/chrome/test/webdriver/webdriver_logging.cc b/chrome/test/webdriver/webdriver_logging.cc
index 28194214a663e3caa9feca702704dab6359b40e7..edb02d4124c738738219c234d17e930d85a70a9b 100644
--- a/chrome/test/webdriver/webdriver_logging.cc
+++ b/chrome/test/webdriver/webdriver_logging.cc
@@ -156,17 +156,10 @@ InMemoryLog::~InMemoryLog() { }
void InMemoryLog::Log(LogLevel level, const base::Time& time,
const std::string& message) {
- // base's JSONWriter doesn't obey the spec, and writes
- // doubles without a fraction with a '.0' postfix. base's Value class
- // only includes doubles or int types. Instead of returning the timestamp
- // in unix epoch time, we return it based on the start of chromedriver so
- // a 32-bit int doesn't overflow.
- // TODO(kkania): Add int64_t to base Values or fix the JSONWriter/Reader and
- // use unix epoch time.
- base::TimeDelta delta(time - base::Time::FromDoubleT(start_time));
+ base::TimeDelta delta = time - base::Time::UnixEpoch();
DictionaryValue* entry = new DictionaryValue();
entry->SetInteger("level", level);
- entry->SetInteger("timestamp", delta.InMilliseconds());
+ entry->SetDouble("timestamp", std::floor(delta.InMillisecondsF()));
entry->SetString("message", message);
base::AutoLock auto_lock(entries_lock_);
entries_list_.Append(entry);
« no previous file with comments | « chrome/test/webdriver/commands/response.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698