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

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

Issue 42628: - Add UI test for the V8 Benchmark Suite.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/ui/javascript_test_util.cc ('k') | chrome/test/ui/sunspider_uitest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/sunspider_uitest.cc
===================================================================
--- chrome/test/ui/sunspider_uitest.cc (revision 12816)
+++ chrome/test/ui/sunspider_uitest.cc (working copy)
@@ -12,6 +12,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/json_value_serializer.h"
#include "chrome/test/automation/tab_proxy.h"
+#include "chrome/test/ui/javascript_test_util.h"
#include "chrome/test/ui/ui_test.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_util.h"
@@ -91,42 +92,7 @@
return false;
std::string json = WideToUTF8(json_wide);
- JSONStringValueSerializer deserializer(json);
- scoped_ptr<Value> root(deserializer.Deserialize(NULL));
-
- EXPECT_TRUE(root.get());
- if (!root.get())
- return false;
-
- EXPECT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
- if (!root->IsType(Value::TYPE_DICTIONARY))
- return false;
-
- DictionaryValue* dict = static_cast<DictionaryValue*>(root.get());
-
- DictionaryValue::key_iterator it = dict->begin_keys();
- for (; it != dict->end_keys(); ++it) {
- Value* value = NULL;
- succeeded = dict->Get(*it, &value);
-
- EXPECT_TRUE(succeeded);
- if (!succeeded)
- continue;
-
- EXPECT_TRUE(value->IsType(Value::TYPE_STRING));
- if (value->IsType(Value::TYPE_STRING)) {
- std::string key = WideToUTF8(*it);
-
- std::string result;
- succeeded = value->GetAsString(&result);
- EXPECT_TRUE(succeeded);
-
- if (succeeded)
- results->insert(std::make_pair(key, result));
- }
- }
-
- return true;
+ return JsonDictionaryToMap(json, results);
}
void PrintResults(TabProxy* tab) {
« no previous file with comments | « chrome/test/ui/javascript_test_util.cc ('k') | chrome/test/ui/sunspider_uitest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698