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

Side by Side Diff: chrome/browser/safe_json_parser_browsertest.cc

Issue 1211793002: Rename safe_json_parser component to safe_json. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/json/json_reader.h" 6 #include "base/json/json_reader.h"
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
11 #include "components/safe_json_parser/safe_json_parser.h" 11 #include "components/safe_json/safe_json_parser.h"
12 #include "content/public/test/test_browser_thread_bundle.h" 12 #include "content/public/test/test_browser_thread_bundle.h"
13 #include "content/public/test/test_utils.h" 13 #include "content/public/test/test_utils.h"
14 14
15 namespace { 15 namespace {
16 16
17 using safe_json_parser::SafeJsonParser; 17 using safe_json::SafeJsonParser;
18 18
19 std::string MaybeToJson(const base::Value* value) { 19 std::string MaybeToJson(const base::Value* value) {
20 if (!value) 20 if (!value)
21 return "(null)"; 21 return "(null)";
22 22
23 std::string json; 23 std::string json;
24 if (!base::JSONWriter::Write(*value, &json)) 24 if (!base::JSONWriter::Write(*value, &json))
25 return "(invalid value)"; 25 return "(invalid value)";
26 26
27 return json; 27 return json;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 TestParse("\"laser\""); 97 TestParse("\"laser\"");
98 TestParse("false"); 98 TestParse("false");
99 TestParse("null"); 99 TestParse("null");
100 TestParse("3.14"); 100 TestParse("3.14");
101 TestParse("["); 101 TestParse("[");
102 TestParse("\""); 102 TestParse("\"");
103 TestParse(std::string()); 103 TestParse(std::string());
104 TestParse("☃"); 104 TestParse("☃");
105 TestParse("\"☃\""); 105 TestParse("\"☃\"");
106 } 106 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_install_helper.cc ('k') | chrome/browser/supervised_user/supervised_user_site_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698