15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file. 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 5effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch#include "content/public/test/content_browser_test.h" 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 7a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace base { 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class CommandLine; 9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)} 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace content { 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Contains stuff WebRTC browsertests have in common. 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class WebRtcContentBrowserTest: public ContentBrowserTest { 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public: 16a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void SetUp() OVERRIDE; 181320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci virtual void TearDown() OVERRIDE; 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) protected: 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Executes |javascript|. The script is required to use 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // window.domAutomationController.send to send a string value back to here. 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) std::string ExecuteJavascriptAndReturnResult( 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const std::string& javascript); 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Waits for the javascript to return OK via the automation controller. 27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // If the javascript returns != OK or times out, we fail the test. 28a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) void ExecuteJavascriptAndWaitForOk(const std::string& javascript); 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 301320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci void DisableOpusIfOnAndroid(); 311320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci 325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Generates javascript code for a getUserMedia call. 335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) std::string GenerateGetUserMediaCall(const char* function_name, 345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int min_width, 355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int max_width, 365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int min_height, 375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int max_height, 385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int min_frame_rate, 395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int max_frame_rate) const; 405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}; 415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 425d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} // namespace content 43