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 "content/test/content_browser_test.h" | 5 #include "content/test/content_browser_test.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 // Class used to automate running media related browser tests. The functions | 9 // Class used to automate running media related browser tests. The functions |
10 // assume that media files are located under files/media/ folder known to | 10 // assume that media files are located under files/media/ folder known to |
11 // the test http server. | 11 // the test http server. |
12 class MediaBrowserTest : public ContentBrowserTest { | 12 class MediaBrowserTest : public ContentBrowserTest { |
13 public: | 13 public: |
14 static const char kEnded[]; | 14 static const char kEnded[]; |
15 static const char kError[]; | 15 static const char kError[]; |
16 static const char kFailed[]; | 16 static const char kFailed[]; |
17 | 17 |
18 typedef std::pair<const char*, const char*> StringPair; | 18 typedef std::pair<const char*, const char*> StringPair; |
19 | 19 |
| 20 virtual void SetUp() OVERRIDE; |
| 21 |
20 // Runs a html page with a list of URL query parameters. | 22 // Runs a html page with a list of URL query parameters. |
21 // If http is true, the test starts a local http test server to load the test | 23 // If http is true, the test starts a local http test server to load the test |
22 // page, otherwise a local file URL is loaded inside the content shell. | 24 // page, otherwise a local file URL is loaded inside the content shell. |
23 // It uses RunTest() to check for expected test output. | 25 // It uses RunTest() to check for expected test output. |
24 void RunMediaTestPage(const char* html_page, | 26 void RunMediaTestPage(const char* html_page, |
25 std::vector<StringPair>* query_params, | 27 std::vector<StringPair>* query_params, |
26 const char* expected, bool http); | 28 const char* expected, bool http); |
27 | 29 |
28 // Opens a URL and waits for the document title to match either one of the | 30 // Opens a URL and waits for the document title to match either one of the |
29 // default strings or the expected string. | 31 // default strings or the expected string. |
30 void RunTest(const GURL& gurl, const char* expected); | 32 void RunTest(const GURL& gurl, const char* expected); |
31 }; | 33 }; |
32 | 34 |
33 } // namespace content | 35 } // namespace content |
OLD | NEW |