| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/media/media_browsertest.h" | 5 #include "chrome/browser/media/media_browsertest.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 const char MediaBrowserTest::kFailed[] = "FAILED"; | 21 const char MediaBrowserTest::kFailed[] = "FAILED"; |
| 22 const char MediaBrowserTest::kPluginCrashed[] = "PLUGIN_CRASHED"; | 22 const char MediaBrowserTest::kPluginCrashed[] = "PLUGIN_CRASHED"; |
| 23 | 23 |
| 24 MediaBrowserTest::MediaBrowserTest() : ignore_plugin_crash_(false) { | 24 MediaBrowserTest::MediaBrowserTest() : ignore_plugin_crash_(false) { |
| 25 } | 25 } |
| 26 | 26 |
| 27 MediaBrowserTest::~MediaBrowserTest() { | 27 MediaBrowserTest::~MediaBrowserTest() { |
| 28 } | 28 } |
| 29 | 29 |
| 30 void MediaBrowserTest::RunMediaTestPage(const std::string& html_page, | 30 void MediaBrowserTest::RunMediaTestPage(const std::string& html_page, |
| 31 const media::QueryParams& query_params, | 31 const base::StringPairs& query_params, |
| 32 const std::string& expected_title, | 32 const std::string& expected_title, |
| 33 bool http) { | 33 bool http) { |
| 34 GURL gurl; | 34 GURL gurl; |
| 35 std::string query = media::GetURLQueryString(query_params); | 35 std::string query = media::GetURLQueryString(query_params); |
| 36 scoped_ptr<net::SpawnedTestServer> http_test_server; | 36 scoped_ptr<net::SpawnedTestServer> http_test_server; |
| 37 if (http) { | 37 if (http) { |
| 38 http_test_server.reset( | 38 http_test_server.reset( |
| 39 new net::SpawnedTestServer(net::SpawnedTestServer::TYPE_HTTP, | 39 new net::SpawnedTestServer(net::SpawnedTestServer::TYPE_HTTP, |
| 40 net::SpawnedTestServer::kLocalhost, | 40 net::SpawnedTestServer::kLocalhost, |
| 41 media::GetTestDataPath())); | 41 media::GetTestDataPath())); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Update document title to quit TitleWatcher early. | 78 // Update document title to quit TitleWatcher early. |
| 79 web_contents()->GetController().GetActiveEntry() | 79 web_contents()->GetController().GetActiveEntry() |
| 80 ->SetTitle(base::ASCIIToUTF16(kPluginCrashed)); | 80 ->SetTitle(base::ASCIIToUTF16(kPluginCrashed)); |
| 81 ADD_FAILURE() << "Failing test due to plugin crash."; | 81 ADD_FAILURE() << "Failing test due to plugin crash."; |
| 82 } | 82 } |
| 83 | 83 |
| 84 void MediaBrowserTest::IgnorePluginCrash() { | 84 void MediaBrowserTest::IgnorePluginCrash() { |
| 85 ignore_plugin_crash_ = true; | 85 ignore_plugin_crash_ = true; |
| 86 } | 86 } |
| 87 | 87 |
| OLD | NEW |