| 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/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 12 #include "chrome/test/base/ui_test_utils.h" | 12 #include "chrome/test/base/ui_test_utils.h" |
| 13 #include "content/public/browser/navigation_controller.h" | 13 #include "content/public/browser/navigation_controller.h" |
| 14 #include "content/public/browser/navigation_entry.h" | 14 #include "content/public/browser/navigation_entry.h" |
| 15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 16 #include "content/public/test/browser_test_utils.h" | 16 #include "content/public/test/browser_test_utils.h" |
| 17 #include "media/base/test_data_util.h" | 17 #include "media/base/test_data_util.h" |
| 18 #include "net/test/embedded_test_server/embedded_test_server.h" | 18 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 19 | 19 |
| 20 namespace chrome { |
| 21 |
| 22 // TODO(sandersd): Change the tests to use a more unique message. |
| 23 // See http://crbug.com/592067 |
| 24 |
| 20 // Normal failure title. | 25 // Normal failure title. |
| 21 const char MediaBrowserTest::kFailed[] = "FAILED"; | 26 const char MediaBrowserTest::kFailed[] = "FAILED"; |
| 22 | 27 |
| 23 // Capitalized event name set by Utils.installTitleEventHandler(). | 28 // Upper case event name set by Utils.installTitleEventHandler(). |
| 24 const char MediaBrowserTest::kEnded[] = "ENDED"; | 29 const char MediaBrowserTest::kEnded[] = "ENDED"; |
| 25 | 30 |
| 26 // Uncapitalized event name as set by Utils.failTest(). | 31 // Lower case event name as set by Utils.failTest(). |
| 27 // TODO(sandersd): Change the tests to use a more unique message. | |
| 28 const char MediaBrowserTest::kError[] = "error"; | 32 const char MediaBrowserTest::kError[] = "error"; |
| 29 | 33 |
| 30 MediaBrowserTest::MediaBrowserTest() : ignore_plugin_crash_(false) {} | 34 MediaBrowserTest::MediaBrowserTest() : ignore_plugin_crash_(false) {} |
| 31 | 35 |
| 32 MediaBrowserTest::~MediaBrowserTest() {} | 36 MediaBrowserTest::~MediaBrowserTest() {} |
| 33 | 37 |
| 34 void MediaBrowserTest::RunMediaTestPage(const std::string& html_page, | 38 void MediaBrowserTest::RunMediaTestPage(const std::string& html_page, |
| 35 const base::StringPairs& query_params, | 39 const base::StringPairs& query_params, |
| 36 const std::string& expected_title, | 40 const std::string& expected_title, |
| 37 bool http) { | 41 bool http) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 base::ProcessId plugin_pid) { | 82 base::ProcessId plugin_pid) { |
| 79 DVLOG(0) << "Plugin crashed: " << plugin_path.value(); | 83 DVLOG(0) << "Plugin crashed: " << plugin_path.value(); |
| 80 if (ignore_plugin_crash_) | 84 if (ignore_plugin_crash_) |
| 81 return; | 85 return; |
| 82 ADD_FAILURE() << "Failing test due to plugin crash."; | 86 ADD_FAILURE() << "Failing test due to plugin crash."; |
| 83 } | 87 } |
| 84 | 88 |
| 85 void MediaBrowserTest::IgnorePluginCrash() { | 89 void MediaBrowserTest::IgnorePluginCrash() { |
| 86 ignore_plugin_crash_ = true; | 90 ignore_plugin_crash_ = true; |
| 87 } | 91 } |
| 92 |
| 93 } // namespace chrome |
| OLD | NEW |