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 #ifndef CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_ |
6 #define CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 static const char kPluginCrashed[]; | 29 static const char kPluginCrashed[]; |
30 | 30 |
31 MediaBrowserTest(); | 31 MediaBrowserTest(); |
32 virtual ~MediaBrowserTest(); | 32 virtual ~MediaBrowserTest(); |
33 | 33 |
34 // Runs a html page with a list of URL query parameters. | 34 // Runs a html page with a list of URL query parameters. |
35 // If http is true, the test starts a local http test server to load the test | 35 // If http is true, the test starts a local http test server to load the test |
36 // page, otherwise a local file URL is loaded inside the content shell. | 36 // page, otherwise a local file URL is loaded inside the content shell. |
37 // It uses RunTest() to check for expected test output. | 37 // It uses RunTest() to check for expected test output. |
38 void RunMediaTestPage(const std::string& html_page, | 38 void RunMediaTestPage(const std::string& html_page, |
39 const media::QueryParams& query_params, | 39 const base::StringPairs& query_params, |
40 const std::string& expected, | 40 const std::string& expected, |
41 bool http); | 41 bool http); |
42 | 42 |
43 // Opens a URL and waits for the document title to match either one of the | 43 // Opens a URL and waits for the document title to match either one of the |
44 // default strings or the expected string. Returns the matching title value. | 44 // default strings or the expected string. Returns the matching title value. |
45 std::string RunTest(const GURL& gurl, const std::string& expected); | 45 std::string RunTest(const GURL& gurl, const std::string& expected); |
46 | 46 |
47 virtual void AddWaitForTitles(content::TitleWatcher* title_watcher); | 47 virtual void AddWaitForTitles(content::TitleWatcher* title_watcher); |
48 | 48 |
49 // Fails test and sets document title to kPluginCrashed when a plugin crashes. | 49 // Fails test and sets document title to kPluginCrashed when a plugin crashes. |
50 // If IgnorePluginCrash(true) is called then plugin crash is ignored. | 50 // If IgnorePluginCrash(true) is called then plugin crash is ignored. |
51 virtual void PluginCrashed(const base::FilePath& plugin_path, | 51 virtual void PluginCrashed(const base::FilePath& plugin_path, |
52 base::ProcessId plugin_pid) OVERRIDE; | 52 base::ProcessId plugin_pid) OVERRIDE; |
53 | 53 |
54 // When called, the test will ignore any plugin crashes and not fail the test. | 54 // When called, the test will ignore any plugin crashes and not fail the test. |
55 void IgnorePluginCrash(); | 55 void IgnorePluginCrash(); |
56 | 56 |
57 private: | 57 private: |
58 bool ignore_plugin_crash_; | 58 bool ignore_plugin_crash_; |
59 }; | 59 }; |
60 | 60 |
61 #endif // CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_ | 61 #endif // CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_ |
OLD | NEW |