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

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

Issue 223163003: Remove the remaining automation-based tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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.h ('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 261647)
+++ chrome/test/ui/javascript_test_util.cc (working copy)
@@ -1,47 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/test/ui/javascript_test_util.h"
-
-#include "base/json/json_string_value_serializer.h"
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/values.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-bool JsonDictionaryToMap(const std::string& json,
- std::map<std::string, std::string>* results) {
- DCHECK(results != NULL);
- JSONStringValueSerializer deserializer(json);
- scoped_ptr<base::Value> root(deserializer.Deserialize(NULL, NULL));
-
- // Note that we don't use ASSERT_TRUE here (and in some other places) as it
- // doesn't work inside a function with a return type other than void.
- EXPECT_TRUE(root.get());
- if (!root.get())
- return false;
-
- EXPECT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY));
- if (!root->IsType(base::Value::TYPE_DICTIONARY))
- return false;
-
- base::DictionaryValue* dict = static_cast<base::DictionaryValue*>(root.get());
-
- for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) {
- double double_result;
- std::string result;
- if (it.value().GetAsString(&result)) {
- } else if (it.value().GetAsDouble(&double_result)) {
- result = base::DoubleToString(double_result);
- } else {
- NOTREACHED() << "Value type not supported!";
- return false;
- }
- results->insert(std::make_pair(it.key(), result));
- }
-
- return true;
-}
« no previous file with comments | « chrome/test/ui/javascript_test_util.h ('k') | chrome/test/ui/ui_perf_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698