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

Side by Side Diff: media/base/test_data_util.cc

Issue 438963005: Purge net/ and ui/base from media_unittest DEPS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove gl from perftests. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « media/base/test_data_util.h ('k') | media/media.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "media/base/test_data_util.h" 5 #include "media/base/test_data_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 18 matching lines...) Expand all
29 std::string query = ""; 29 std::string query = "";
30 QueryParams::const_iterator itr = query_params.begin(); 30 QueryParams::const_iterator itr = query_params.begin();
31 for (; itr != query_params.end(); ++itr) { 31 for (; itr != query_params.end(); ++itr) {
32 if (itr != query_params.begin()) 32 if (itr != query_params.begin())
33 query.append("&"); 33 query.append("&");
34 query.append(itr->first + "=" + itr->second); 34 query.append(itr->first + "=" + itr->second);
35 } 35 }
36 return query; 36 return query;
37 } 37 }
38 38
39 scoped_ptr<net::SpawnedTestServer> StartMediaHttpTestServer() {
40 scoped_ptr<net::SpawnedTestServer> http_test_server;
41 http_test_server.reset(new net::SpawnedTestServer(
42 net::SpawnedTestServer::TYPE_HTTP,
43 net::SpawnedTestServer::kLocalhost,
44 GetTestDataPath()));
45 CHECK(http_test_server->Start());
46 return http_test_server.Pass();
47 }
48
49 scoped_refptr<DecoderBuffer> ReadTestDataFile(const std::string& name) { 39 scoped_refptr<DecoderBuffer> ReadTestDataFile(const std::string& name) {
50 base::FilePath file_path = GetTestDataFilePath(name); 40 base::FilePath file_path = GetTestDataFilePath(name);
51 41
52 int64 tmp = 0; 42 int64 tmp = 0;
53 CHECK(base::GetFileSize(file_path, &tmp)) 43 CHECK(base::GetFileSize(file_path, &tmp))
54 << "Failed to get file size for '" << name << "'"; 44 << "Failed to get file size for '" << name << "'";
55 45
56 int file_size = base::checked_cast<int>(tmp); 46 int file_size = base::checked_cast<int>(tmp);
57 47
58 scoped_refptr<DecoderBuffer> buffer(new DecoderBuffer(file_size)); 48 scoped_refptr<DecoderBuffer> buffer(new DecoderBuffer(file_size));
59 CHECK_EQ(file_size, 49 CHECK_EQ(file_size,
60 base::ReadFile( 50 base::ReadFile(
61 file_path, reinterpret_cast<char*>(buffer->writable_data()), 51 file_path, reinterpret_cast<char*>(buffer->writable_data()),
62 file_size)) << "Failed to read '" << name << "'"; 52 file_size)) << "Failed to read '" << name << "'";
63 53
64 return buffer; 54 return buffer;
65 } 55 }
66 56
67 } // namespace media 57 } // namespace media
OLDNEW
« no previous file with comments | « media/base/test_data_util.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698