Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 "base/command_line.h" | |
| 6 #include "base/files/file_path.h" | |
| 7 #include "base/path_service.h" | |
| 8 #include "build/build_config.h" | |
| 9 #include "chrome/browser/media/webrtc_browsertest_base.h" | |
| 10 #include "chrome/browser/media/webrtc_browsertest_common.h" | |
| 11 #include "chrome/browser/ui/browser.h" | |
| 12 #include "chrome/browser/ui/browser_tabstrip.h" | |
| 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
| 14 #include "chrome/common/chrome_switches.h" | |
| 15 #include "chrome/test/base/in_process_browser_test.h" | |
| 16 #include "chrome/test/base/ui_test_utils.h" | |
| 17 #include "content/public/browser/notification_service.h" | |
| 18 #include "content/public/browser/render_process_host.h" | |
| 19 #include "content/public/common/content_switches.h" | |
| 20 #include "content/public/test/browser_test_utils.h" | |
| 21 #include "media/base/media_switches.h" | |
| 22 #include "net/test/embedded_test_server/embedded_test_server.h" | |
| 23 #include "testing/perf/perf_test.h" | |
| 24 #include "ui/gl/gl_switches.h" | |
| 25 | |
| 26 static const char kCanvasTestHtmlPage[] = "/media/canvas_capture_test.html"; | |
| 27 | |
| 28 // Canvas Capture browser test. | |
| 29 // At this time this browser test verifies that the frame rate of a stream | |
| 30 // originated from a captured canvas is as expected. | |
| 31 class WebRtcCanvasCaptureBrowserTest : public WebRtcTestBase { | |
|
phoglund_chromium
2016/02/12 08:38:53
It doesn't make sense to inherit from WebRtcTestBa
cpaulin (no longer in chrome)
2016/02/12 20:14:32
Done.
| |
| 32 public: | |
| 33 void SetUpInProcessBrowserTestFixture() override { | |
| 34 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. | |
| 35 } | |
| 36 | |
| 37 void SetUpCommandLine(base::CommandLine* command_line) override { | |
| 38 // The video playback will not work without a GPU, so force its use here. | |
| 39 command_line->AppendSwitch(switches::kUseGpuInTests); | |
| 40 | |
| 41 command_line->AppendSwitch( | |
| 42 switches::kEnableExperimentalWebPlatformFeatures); | |
| 43 } | |
| 44 }; | |
| 45 | |
| 46 // Tests that the frame rate of the canvas capture is as expected. | |
| 47 IN_PROC_BROWSER_TEST_F(WebRtcCanvasCaptureBrowserTest, | |
| 48 VerifyCanvasCaptureFrameRate) { | |
| 49 ASSERT_TRUE(embedded_test_server()->Start()); | |
| 50 | |
| 51 ui_test_utils::NavigateToURL( | |
| 52 browser(), embedded_test_server()->GetURL(kCanvasTestHtmlPage)); | |
| 53 | |
| 54 content::WebContents* tab_contents = | |
| 55 browser()->tab_strip_model()->GetActiveWebContents(); | |
| 56 | |
| 57 ASSERT_EQ("OK", ExecuteJavascript("testFrameRateOfCanvasCapture();", | |
| 58 tab_contents)); | |
| 59 } | |
| OLD | NEW |