Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Side by Side Diff: chrome/browser/media/media_browsertest.cc

Issue 308553002: Integrate browser tests with new EME player. (Closed) Base URL: http://git.chromium.org/chromium/src.git@eme_player
Patch Set: Add support for FileIO and LoadSession test cases Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698