Commit 6523eb5c authored by ukai@chromium.org's avatar ukai@chromium.org

Revert 86572 - Revert 86568 - Add initial framework for performance tests that measure frame rate.

Add the "blank page" test, which just scrolls a page with a very large body.
The actual frame rate measurement is based on the webkitRequestAnimationFrame
callback.  The framework records how frequently that API generates a callback.
If it generates a callback at 60 FPS, then we know nothing is slowing us down.
This of course assumes that webkitRequestAnimationFrame is well implemented.

The advantage of this test framework over one that directly reads a framerate
from Chromium is that this one works outside of the test harness.  You can just
navigate your browser to the test file and run the test manually.

R=brettw,nduca
Review URL: http://codereview.chromium.org/7038052

TBR=darin@chromium.org
Review URL: http://codereview.chromium.org/7068005
Review URL: http://codereview.chromium.org/7031043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86577 0039d316-1c4b-4281-b951-d872f2087c98
parent 7b7f9bab
......@@ -2879,6 +2879,50 @@
}],
],
},
{
'target_name': 'performance_ui_tests',
'type': 'executable',
'msvs_guid': 'C3539D2F-B87A-4F9B-8220-1BB5F7119720',
'dependencies': [
'chrome',
'chrome_resources',
'chrome_strings',
'debugger',
'test_support_common',
'test_support_ui',
'../base/base.gyp:base',
'../skia/skia.gyp:skia',
'../testing/gtest.gyp:gtest',
],
'sources': [
# TODO(darin): Move other UIPerfTests here.
'test/perf/frame_rate/frame_rate_tests.cc',
],
'conditions': [
['OS=="win" and buildtype=="Official"', {
'configurations': {
'Release': {
'msvs_settings': {
'VCCLCompilerTool': {
'WholeProgramOptimization': 'false',
},
},
},
},
},],
['OS=="linux"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
],
}],
['toolkit_views==1', {
'dependencies': [
'../views/views.gyp:views',
],
}],
],
},
{
'target_name': 'tab_switching_test',
'type': 'executable',
......
......@@ -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 @@ bool JsonDictionaryToMap(const std::string& json,
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);
if (succeeded)
results->insert(std::make_pair(key, result));
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;
}
EXPECT_TRUE(succeeded);
if (succeeded)
results->insert(std::make_pair(key, result));
}
return true;
......
......@@ -45,7 +45,7 @@ class UIPerfTest : public UITest {
bool important);
// Like PrintResult(), but prints a (mean, standard deviation) result pair.
// The |<values>| should be two comma-seaprated numbers, the mean and
// The |<values>| should be two comma-separated numbers, the mean and
// standard deviation (or other error metric) of the measurement.
void PrintResultMeanAndError(const std::string& measurement,
const std::string& modifier,
......
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