Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef MEDIA_BASE_TEST_DATA_UTIL_H_ | 5 #ifndef MEDIA_BASE_TEST_DATA_UTIL_H_ |
| 6 #define MEDIA_BASE_TEST_DATA_UTIL_H_ | 6 #define MEDIA_BASE_TEST_DATA_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/strings/string_split.h" | |
| 16 | 17 |
| 17 namespace media { | 18 namespace media { |
| 18 | 19 |
| 19 class DecoderBuffer; | 20 class DecoderBuffer; |
| 20 | 21 |
| 21 typedef std::vector<std::pair<std::string, std::string> > QueryParams; | 22 typedef base::StringPairs QueryParams; |
|
DaleCurtis
2014/09/23 17:14:48
Looks like there's only a couple callers to GetURL
| |
| 22 | 23 |
| 23 // Returns a file path for a file in the media/test/data directory. | 24 // Returns a file path for a file in the media/test/data directory. |
| 24 base::FilePath GetTestDataFilePath(const std::string& name); | 25 base::FilePath GetTestDataFilePath(const std::string& name); |
| 25 | 26 |
| 26 // Returns relative path for test data folder: media/test/data. | 27 // Returns relative path for test data folder: media/test/data. |
| 27 base::FilePath GetTestDataPath(); | 28 base::FilePath GetTestDataPath(); |
| 28 | 29 |
| 29 // Returns a string containing key value query params in the form of: | 30 // Returns a string containing key value query params in the form of: |
| 30 // "key_1=value_1&key_2=value2" | 31 // "key_1=value_1&key_2=value2" |
| 31 std::string GetURLQueryString(const QueryParams& query_params); | 32 std::string GetURLQueryString(const QueryParams& query_params); |
| 32 | 33 |
| 33 // Reads a test file from media/test/data directory and stores it in | 34 // Reads a test file from media/test/data directory and stores it in |
| 34 // a DecoderBuffer. Use DecoderBuffer vs DataBuffer to ensure no matter | 35 // a DecoderBuffer. Use DecoderBuffer vs DataBuffer to ensure no matter |
| 35 // what a test does, it's safe to use FFmpeg methods. | 36 // what a test does, it's safe to use FFmpeg methods. |
| 36 // | 37 // |
| 37 // |name| - The name of the file. | 38 // |name| - The name of the file. |
| 38 // |buffer| - The contents of the file. | 39 // |buffer| - The contents of the file. |
| 39 scoped_refptr<DecoderBuffer> ReadTestDataFile(const std::string& name); | 40 scoped_refptr<DecoderBuffer> ReadTestDataFile(const std::string& name); |
| 40 | 41 |
| 41 } // namespace media | 42 } // namespace media |
| 42 | 43 |
| 43 #endif // MEDIA_BASE_TEST_DATA_UTIL_H_ | 44 #endif // MEDIA_BASE_TEST_DATA_UTIL_H_ |
| OLD | NEW |