IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / browser / media / media_browsertest.h
blob6637ead270645c6100fbe6192b7b1e80ce70eb3e
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 CONTENT_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
6 #define CONTENT_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
8 #include <utility>
9 #include <vector>
11 #include "content/test/content_browser_test.h"
13 namespace content {
15 class TitleWatcher;
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 ContentBrowserTest {
21 public:
22 typedef std::pair<const char*, const char*> StringPair;
24 // Common test results.
25 static const char kEnded[];
26 static const char kError[];
27 static const char kFailed[];
29 virtual void SetUp() OVERRIDE;
31 // Runs a html page with a list of URL query parameters.
32 // If http is true, the test starts a local http test server to load the test
33 // page, otherwise a local file URL is loaded inside the content shell.
34 // It uses RunTest() to check for expected test output.
35 void RunMediaTestPage(const char* html_page,
36 std::vector<StringPair>* query_params,
37 const char* expected, bool http);
39 // Opens a URL and waits for the document title to match either one of the
40 // default strings or the expected string.
41 void RunTest(const GURL& gurl, const char* expected);
43 virtual void AddWaitForTitles(content::TitleWatcher* title_watcher);
46 } // namespace content
48 #endif // CONTENT_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_