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/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 .AppendASCII(html_page); | 51 .AppendASCII(html_page); |
52 gurl = content::GetFileUrlWithQuery(test_file_path, query); | 52 gurl = content::GetFileUrlWithQuery(test_file_path, query); |
53 } | 53 } |
54 | 54 |
55 base::string16 final_title = RunTest(gurl, expected_title); | 55 base::string16 final_title = RunTest(gurl, expected_title); |
56 EXPECT_EQ(base::ASCIIToUTF16(expected_title), final_title); | 56 EXPECT_EQ(base::ASCIIToUTF16(expected_title), final_title); |
57 } | 57 } |
58 | 58 |
59 base::string16 MediaBrowserTest::RunTest(const GURL& gurl, | 59 base::string16 MediaBrowserTest::RunTest(const GURL& gurl, |
60 const std::string& expected_title) { | 60 const std::string& expected_title) { |
61 DVLOG(1) << "Running test URL: " << gurl; | 61 VLOG(0) << "Running test URL: " << gurl; |
62 // Observe the web contents for plugin crashes. | 62 // Observe the web contents for plugin crashes. |
63 Observe(browser()->tab_strip_model()->GetActiveWebContents()); | 63 Observe(browser()->tab_strip_model()->GetActiveWebContents()); |
64 content::TitleWatcher title_watcher( | 64 content::TitleWatcher title_watcher( |
65 browser()->tab_strip_model()->GetActiveWebContents(), | 65 browser()->tab_strip_model()->GetActiveWebContents(), |
66 base::ASCIIToUTF16(expected_title)); | 66 base::ASCIIToUTF16(expected_title)); |
67 AddWaitForTitles(&title_watcher); | 67 AddWaitForTitles(&title_watcher); |
68 ui_test_utils::NavigateToURL(browser(), gurl); | 68 ui_test_utils::NavigateToURL(browser(), gurl); |
69 | 69 |
70 return title_watcher.WaitAndGetTitle(); | 70 return title_watcher.WaitAndGetTitle(); |
71 } | 71 } |
(...skipping 13 matching lines...) Expand all Loading... |
85 // Update document title to quit TitleWatcher early. | 85 // Update document title to quit TitleWatcher early. |
86 web_contents()->GetController().GetActiveEntry() | 86 web_contents()->GetController().GetActiveEntry() |
87 ->SetTitle(base::ASCIIToUTF16(kPluginCrashed)); | 87 ->SetTitle(base::ASCIIToUTF16(kPluginCrashed)); |
88 ADD_FAILURE() << "Failing test due to plugin crash."; | 88 ADD_FAILURE() << "Failing test due to plugin crash."; |
89 } | 89 } |
90 | 90 |
91 void MediaBrowserTest::IgnorePluginCrash() { | 91 void MediaBrowserTest::IgnorePluginCrash() { |
92 ignore_plugin_crash_ = true; | 92 ignore_plugin_crash_ = true; |
93 } | 93 } |
94 | 94 |
OLD | NEW |