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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
6 #define CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
11 #include "chrome/test/base/in_process_browser_test.h"
17 // Class used to automate running media related browser tests. The functions
18 // assume that media files are located under files/media/ folder known to
19 // the test http server.
20 class MediaBrowserTest
: public InProcessBrowserTest
{
22 typedef std::pair
<const char*, const char*> StringPair
;
24 // Common test results.
25 static const char kEnded
[];
26 // TODO(xhwang): Report detailed errors, e.g. "ERROR-3".
27 static const char kError
[];
28 static const char kFailed
[];
31 virtual ~MediaBrowserTest();
33 // Runs a html page with a list of URL query parameters.
34 // If http is true, the test starts a local http test server to load the test
35 // page, otherwise a local file URL is loaded inside the content shell.
36 // It uses RunTest() to check for expected test output.
37 void RunMediaTestPage(const char* html_page
,
38 std::vector
<StringPair
>* query_params
,
39 const char* expected
, bool http
);
41 // Opens a URL and waits for the document title to match either one of the
42 // default strings or the expected string.
43 base::string16
RunTest(const GURL
& gurl
, const char* expected
);
45 virtual void AddWaitForTitles(content::TitleWatcher
* title_watcher
);
48 #endif // CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_