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

Side by Side Diff: chrome/test/media_router/media_router_integration_browsertest.cc

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add todo about not failed trybot Created 5 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/test/media_router/media_router_integration_browsertest.h" 5 #include "chrome/test/media_router/media_router_integration_browsertest.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 CHECK(dialog_contents); 151 CHECK(dialog_contents);
152 return dialog_contents; 152 return dialog_contents;
153 } 153 }
154 154
155 void MediaRouterIntegrationBrowserTest::SetTestData( 155 void MediaRouterIntegrationBrowserTest::SetTestData(
156 base::FilePath::StringPieceType test_data_file) { 156 base::FilePath::StringPieceType test_data_file) {
157 base::FilePath full_path = GetResourceFile(test_data_file); 157 base::FilePath full_path = GetResourceFile(test_data_file);
158 JSONFileValueDeserializer deserializer(full_path); 158 JSONFileValueDeserializer deserializer(full_path);
159 int error_code = 0; 159 int error_code = 0;
160 std::string error_message; 160 std::string error_message;
161 scoped_ptr<base::Value> value( 161 scoped_ptr<base::Value> value =
162 deserializer.Deserialize(&error_code, &error_message)); 162 deserializer.Deserialize(&error_code, &error_message);
163 CHECK(value.get()) << "Deserialize failed: " << error_message; 163 CHECK(value.get()) << "Deserialize failed: " << error_message;
164 std::string test_data_str; 164 std::string test_data_str;
165 ASSERT_TRUE(base::JSONWriter::Write(*value, &test_data_str)); 165 ASSERT_TRUE(base::JSONWriter::Write(*value, &test_data_str));
166 ExecuteScriptInBackgroundPageNoWait( 166 ExecuteScriptInBackgroundPageNoWait(
167 extension_id_, 167 extension_id_,
168 base::StringPrintf("localStorage['testdata'] = '%s'", 168 base::StringPrintf("localStorage['testdata'] = '%s'",
169 test_data_str.c_str())); 169 test_data_str.c_str()));
170 } 170 }
171 171
172 content::WebContents* MediaRouterIntegrationBrowserTest::OpenMRDialog( 172 content::WebContents* MediaRouterIntegrationBrowserTest::OpenMRDialog(
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 content::WebContents* new_web_contents = 367 content::WebContents* new_web_contents =
368 browser()->tab_strip_model()->GetActiveWebContents(); 368 browser()->tab_strip_model()->GetActiveWebContents();
369 ASSERT_TRUE(new_web_contents); 369 ASSERT_TRUE(new_web_contents);
370 ExecuteJavaScriptAPI( 370 ExecuteJavaScriptAPI(
371 new_web_contents, 371 new_web_contents,
372 base::StringPrintf("checkReconnectSessionFails('%s');", 372 base::StringPrintf("checkReconnectSessionFails('%s');",
373 session_id.c_str())); 373 session_id.c_str()));
374 } 374 }
375 375
376 } // namespace media_router 376 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/installer/util/uninstall_metrics_unittest.cc ('k') | chrome/utility/importer/firefox_importer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698