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

Unified Diff: chrome/test/ui/javascript_test_util.cc

Issue 7038052: Add initial framework for performance tests that measure frame rate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/perf/frame_rate/frame_rate_tests.cc ('k') | chrome/test/ui/ui_perf_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/javascript_test_util.cc
===================================================================
--- chrome/test/ui/javascript_test_util.cc (revision 85645)
+++ chrome/test/ui/javascript_test_util.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "content/common/json_value_serializer.h"
@@ -38,17 +39,28 @@
if (!succeeded)
continue;
- EXPECT_TRUE(value->IsType(Value::TYPE_STRING));
- if (value->IsType(Value::TYPE_STRING)) {
- const std::string& key(*it);
+ const std::string& key(*it);
+ std::string result;
- std::string result;
- succeeded = value->GetAsString(&result);
- EXPECT_TRUE(succeeded);
+ switch (value->GetType()) {
+ case Value::TYPE_STRING:
+ succeeded = value->GetAsString(&result);
+ break;
+ case Value::TYPE_DOUBLE: {
+ double double_result;
+ succeeded = value->GetAsDouble(&double_result);
+ if (succeeded)
+ result = base::DoubleToString(double_result);
+ break;
+ }
+ default:
+ NOTREACHED() << "Value type not supported!";
+ return false;
+ }
- if (succeeded)
- results->insert(std::make_pair(key, result));
- }
+ EXPECT_TRUE(succeeded);
+ if (succeeded)
+ results->insert(std::make_pair(key, result));
}
return true;
« no previous file with comments | « chrome/test/perf/frame_rate/frame_rate_tests.cc ('k') | chrome/test/ui/ui_perf_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698