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