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

Side by Side Diff: chrome/browser/extensions/api/discovery/discovery_api_unittest.cc

Issue 22885002: c/b/extensions, json_schema_compiler: Do not use Value::Create*. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed C-style casts. Created 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file tests the chrome.alarms extension API. 5 // This file tests the chrome.alarms extension API.
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/api/discovery/discovery_api.h" 9 #include "chrome/browser/extensions/api/discovery/discovery_api.h"
10 #include "chrome/browser/extensions/api/discovery/suggested_link.h" 10 #include "chrome/browser/extensions/api/discovery/suggested_link.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 suggest_details.score.reset(new double(score)); 51 suggest_details.score.reset(new double(score));
52 suggest_details.link_url = link_url; 52 suggest_details.link_url = link_url;
53 suggest_details.link_text = link_text; 53 suggest_details.link_text = link_text;
54 return SuggestDetailsParamToJSON(suggest_details); 54 return SuggestDetailsParamToJSON(suggest_details);
55 } 55 }
56 56
57 // Converts the parameters to the API RemoveSuggestion method to JSON. 57 // Converts the parameters to the API RemoveSuggestion method to JSON.
58 std::string RemoveSuggestionParamsToJSON(const std::string& link_url) { 58 std::string RemoveSuggestionParamsToJSON(const std::string& link_url) {
59 std::string result; 59 std::string result;
60 base::ListValue params; 60 base::ListValue params;
61 params.Append(base::Value::CreateStringValue(link_url)); 61 params.Append(new base::StringValue(link_url));
62 base::JSONWriter::Write(&params, &result); 62 base::JSONWriter::Write(&params, &result);
63 return result; 63 return result;
64 } 64 }
65 65
66 } // namespace 66 } // namespace
67 67
68 namespace extensions { 68 namespace extensions {
69 69
70 class ExtensionDiscoveryTest : public BrowserWithTestWindowTest { 70 class ExtensionDiscoveryTest : public BrowserWithTestWindowTest {
71 public: 71 public:
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 extensions::SuggestedLinksRegistry* registry = 182 extensions::SuggestedLinksRegistry* registry =
183 extensions::SuggestedLinksRegistryFactory::GetForProfile( 183 extensions::SuggestedLinksRegistryFactory::GetForProfile(
184 browser()->profile()); 184 browser()->profile());
185 185
186 const SuggestedLinkList* links = registry->GetAll(GetExtensionId()); 186 const SuggestedLinkList* links = registry->GetAll(GetExtensionId());
187 ASSERT_EQ(0u, links->size()); 187 ASSERT_EQ(0u, links->size());
188 } 188 }
189 189
190 } // namespace extensions 190 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/dial/dial_api.cc ('k') | chrome/browser/extensions/api/downloads/downloads_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698