| 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) {
|
|
|