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

Side by Side Diff: chrome/renderer/extensions/extension_api_json_validity_unittest.cc

Issue 3057027: Convert wstring/wchar_t* in chrome/renderer to std::string/char* or string16. (Closed)
Patch Set: utf8 -> utf16 for things coming from resources Created 10 years, 4 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/file_path.h" 5 #include "base/file_path.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "chrome/common/json_value_serializer.h" 9 #include "chrome/common/json_value_serializer.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 // As a basic smoke test that the JSON we read is reasonable, find the 100 // As a basic smoke test that the JSON we read is reasonable, find the
101 // definition of the functions chrome.test.log() and 101 // definition of the functions chrome.test.log() and
102 // chrome.test.notifyPass(). 102 // chrome.test.notifyPass().
103 DictionaryValue* test_namespace_dict; 103 DictionaryValue* test_namespace_dict;
104 ASSERT_TRUE(FindDictionaryWithProperyValue( 104 ASSERT_TRUE(FindDictionaryWithProperyValue(
105 root_list, "namespace", "test", &test_namespace_dict, &error_message)) 105 root_list, "namespace", "test", &test_namespace_dict, &error_message))
106 << error_message; 106 << error_message;
107 107
108 ListValue* functions_list; 108 ListValue* functions_list;
109 ASSERT_TRUE(test_namespace_dict->GetList(L"functions", &functions_list)) 109 ASSERT_TRUE(test_namespace_dict->GetList("functions", &functions_list))
110 << "Namespace 'test' should define some functions."; 110 << "Namespace 'test' should define some functions.";
111 111
112 EXPECT_TRUE(FindDictionaryWithProperyValue( 112 EXPECT_TRUE(FindDictionaryWithProperyValue(
113 functions_list, "name", "log", NULL, &error_message)) 113 functions_list, "name", "log", NULL, &error_message))
114 << error_message; 114 << error_message;
115 115
116 EXPECT_TRUE(FindDictionaryWithProperyValue( 116 EXPECT_TRUE(FindDictionaryWithProperyValue(
117 functions_list, "name", "notifyPass", NULL, &error_message)) 117 functions_list, "name", "notifyPass", NULL, &error_message))
118 << error_message; 118 << error_message;
119 } 119 }
(...skipping 13 matching lines...) Expand all
133 bindings_utils::GetStringResource<IDR_EXTENSION_API_JSON>(); 133 bindings_utils::GetStringResource<IDR_EXTENSION_API_JSON>();
134 134
135 // Create a global variable holding the text of extension_api.json . 135 // Create a global variable holding the text of extension_api.json .
136 SetGlobalStringVar("ext_api_json_text", ext_api_string); 136 SetGlobalStringVar("ext_api_json_text", ext_api_string);
137 137
138 // Parse the text of extension_api.json . If there is a parse error, 138 // Parse the text of extension_api.json . If there is a parse error,
139 // an exception will be printed that includes a line number. 139 // an exception will be printed that includes a line number.
140 std::string test_js = "var extension_api = JSON.parse(ext_api_json_text);"; 140 std::string test_js = "var extension_api = JSON.parse(ext_api_json_text);";
141 ExecuteScriptInContext(test_js, "ParseExtensionApiJson"); 141 ExecuteScriptInContext(test_js, "ParseExtensionApiJson");
142 } 142 }
OLDNEW
« no previous file with comments | « chrome/renderer/blocked_plugin.cc ('k') | chrome/renderer/extensions/extension_process_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698