Commit 2636d976 authored by anand.ratn's avatar anand.ratn Committed by Commit bot

Use base::StringPairs where appropriate for src/media/

Becuase base/strings/string_split.h defines:
typedef std::vector<std::pair<std::string, std::string> > StringPairs;

BUG=412250

Review URL: https://codereview.chromium.org/593023002

Cr-Commit-Position: refs/heads/master@{#297359}
parent 5530ca35
......@@ -118,9 +118,9 @@ class EncryptedMediaTestBase : public MediaBrowserTest {
void RunEncryptedMediaTestPage(
const std::string& html_page,
const std::string& key_system,
const media::QueryParams& query_params,
base::StringPairs& query_params,
const std::string& expected_title) {
media::QueryParams new_query_params = query_params;
base::StringPairs new_query_params = query_params;
StartLicenseServerIfNeeded(key_system, &new_query_params);
RunMediaTestPage(html_page, new_query_params, expected_title, true);
}
......@@ -146,7 +146,7 @@ class EncryptedMediaTestBase : public MediaBrowserTest {
VLOG(0) << "Skipping test - MSE not supported.";
return;
}
media::QueryParams query_params;
base::StringPairs query_params;
query_params.push_back(std::make_pair("mediaFile", media_file));
query_params.push_back(std::make_pair("mediaType", media_type));
query_params.push_back(std::make_pair("keySystem", key_system));
......@@ -193,7 +193,7 @@ class EncryptedMediaTestBase : public MediaBrowserTest {
// Starts a license server if available for the |key_system| and adds a
// 'licenseServerURL' query parameter to |query_params|.
void StartLicenseServerIfNeeded(const std::string& key_system,
media::QueryParams* query_params) {
base::StringPairs* query_params) {
scoped_ptr<TestLicenseServerConfig> config = GetServerConfig(key_system);
if (!config)
return;
......@@ -406,7 +406,7 @@ class EncryptedMediaTest
void TestConfigChange() {
DCHECK(IsMSESupported());
media::QueryParams query_params;
base::StringPairs query_params;
query_params.push_back(std::make_pair("keySystem", CurrentKeySystem()));
query_params.push_back(std::make_pair("runEncrypted", "1"));
if (CurrentEmeVersion() == PREFIXED)
......
......@@ -28,7 +28,7 @@ MediaBrowserTest::~MediaBrowserTest() {
}
void MediaBrowserTest::RunMediaTestPage(const std::string& html_page,
const media::QueryParams& query_params,
const base::StringPairs& query_params,
const std::string& expected_title,
bool http) {
GURL gurl;
......
......@@ -36,7 +36,7 @@ class MediaBrowserTest : public InProcessBrowserTest,
// page, otherwise a local file URL is loaded inside the content shell.
// It uses RunTest() to check for expected test output.
void RunMediaTestPage(const std::string& html_page,
const media::QueryParams& query_params,
const base::StringPairs& query_params,
const std::string& expected,
bool http);
......
......@@ -80,7 +80,7 @@ class EncryptedMediaTest : public content::MediaBrowserTest,
return;
}
media::QueryParams query_params;
base::StringPairs query_params;
query_params.push_back(std::make_pair("keySystem", CurrentKeySystem()));
query_params.push_back(std::make_pair("runEncrypted", "1"));
RunMediaTestPage("mse_config_change.html", query_params, kEnded, true);
......@@ -101,7 +101,7 @@ class EncryptedMediaTest : public content::MediaBrowserTest,
return;
}
media::QueryParams query_params;
base::StringPairs query_params;
query_params.push_back(std::make_pair("mediaFile", media_file));
query_params.push_back(std::make_pair("mediaType", media_type));
query_params.push_back(std::make_pair("keySystem", key_system));
......
......@@ -28,7 +28,7 @@ const char MediaBrowserTest::kError[] = "ERROR";
const char MediaBrowserTest::kFailed[] = "FAILED";
void MediaBrowserTest::RunMediaTestPage(const std::string& html_page,
const media::QueryParams& query_params,
const base::StringPairs& query_params,
const std::string& expected_title,
bool http) {
GURL gurl;
......@@ -94,7 +94,7 @@ class MediaTest : public testing::WithParamInterface<bool>,
void PlayMedia(const std::string& tag,
const std::string& media_file,
bool http) {
media::QueryParams query_params;
base::StringPairs query_params;
query_params.push_back(std::make_pair(tag, media_file));
RunMediaTestPage("player.html", query_params, kEnded, http);
}
......@@ -104,7 +104,7 @@ class MediaTest : public testing::WithParamInterface<bool>,
expected += base::IntToString(width);
expected += " ";
expected += base::IntToString(height);
media::QueryParams query_params;
base::StringPairs query_params;
query_params.push_back(std::make_pair("video", media_file));
RunMediaTestPage("player.html", query_params, expected, false);
}
......
......@@ -29,7 +29,7 @@ class MediaBrowserTest : public ContentBrowserTest {
// page, otherwise a local file URL is loaded inside the content shell.
// It uses RunTest() to check for expected test output.
void RunMediaTestPage(const std::string& html_page,
const media::QueryParams& query_params,
const base::StringPairs& query_params,
const std::string& expected,
bool http);
......
......@@ -40,7 +40,7 @@ class MediaSourceTest : public content::MediaBrowserTest {
return;
}
media::QueryParams query_params;
base::StringPairs query_params;
query_params.push_back(std::make_pair("mediaFile", media_file));
query_params.push_back(std::make_pair("mediaType", media_type));
RunMediaTestPage("media_source_player.html", query_params, expectation,
......@@ -86,7 +86,7 @@ IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) {
return;
}
RunMediaTestPage("mse_config_change.html",
media::QueryParams(),
base::StringPairs(),
kEnded,
true);
}
......
......@@ -25,9 +25,9 @@ base::FilePath GetTestDataPath() {
return base::FilePath(kTestDataPath);
}
std::string GetURLQueryString(const QueryParams& query_params) {
std::string GetURLQueryString(const base::StringPairs& query_params) {
std::string query = "";
QueryParams::const_iterator itr = query_params.begin();
base::StringPairs::const_iterator itr = query_params.begin();
for (; itr != query_params.end(); ++itr) {
if (itr != query_params.begin())
query.append("&");
......
......@@ -13,13 +13,12 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_split.h"
namespace media {
class DecoderBuffer;
typedef std::vector<std::pair<std::string, std::string> > QueryParams;
// Returns a file path for a file in the media/test/data directory.
base::FilePath GetTestDataFilePath(const std::string& name);
......@@ -28,7 +27,7 @@ base::FilePath GetTestDataPath();
// Returns a string containing key value query params in the form of:
// "key_1=value_1&key_2=value2"
std::string GetURLQueryString(const QueryParams& query_params);
std::string GetURLQueryString(const base::StringPairs& query_params);
// Reads a test file from media/test/data directory and stores it in
// a DecoderBuffer. Use DecoderBuffer vs DataBuffer to ensure no matter
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment