Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc

Issue 1221483002: New tabCapture.captureOffscreenTab API, initially for Presentation API 1UA mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc
index 06ae5b293dcda952ff52e9764908d5616ca542c2..aca04db44badced75f10d9ac91cc97b5749586a0 100644
--- a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc
+++ b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc
@@ -43,6 +43,8 @@ class TabCaptureApiTest : public ExtensionApiTest {
// Specify smallish window size to make testing of tab capture less CPU
// intensive.
command_line->AppendSwitchASCII(::switches::kWindowSize, "300,300");
+ // Enable tabCapture.capturePresentation API for testing.
+ command_line->AppendSwitch(::switches::kEnableCapturePresentationApi);
}
void AddExtensionToCommandLineWhitelist() {
@@ -96,6 +98,14 @@ IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, ApiTests) {
ASSERT_TRUE(RunExtensionSubtest("tab_capture", "api_tests.html")) << message_;
}
+// Tests that there is a maximum limitation to the number of simultaneous
+// offscreen presentation sessions.
+IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MaxOffscreenPresentations) {
+ AddExtensionToCommandLineWhitelist();
+ ASSERT_TRUE(RunExtensionSubtest("tab_capture", "max_presentations.html"))
+ << message_;
+}
+
// Tests that tab capture video frames can be received in a VIDEO element.
IN_PROC_BROWSER_TEST_F(TabCaptureApiPixelTest, EndToEndWithoutRemoting) {
if (IsTooIntensiveForThisPlatform()) {
@@ -123,6 +133,19 @@ IN_PROC_BROWSER_TEST_F(TabCaptureApiPixelTest, EndToEndThroughWebRTC) {
<< message_;
}
+// Tests that tab capture video frames can be received in a VIDEO element from
+// an offscreen presentation tab.
+IN_PROC_BROWSER_TEST_F(TabCaptureApiPixelTest, EndToEndOffscreenPresentation) {
+ if (IsTooIntensiveForThisPlatform()) {
+ LOG(WARNING) << "Skipping this CPU-intensive test on this platform/build.";
+ return;
+ }
+ AddExtensionToCommandLineWhitelist();
+ ASSERT_TRUE(RunExtensionSubtest(
+ "tab_capture", "presentation.html?colorDeviation=10"))
+ << message_;
+}
+
// http://crbug.com/177163
#if defined(OS_WIN) && !defined(NDEBUG)
#define MAYBE_GetUserMediaTest DISABLED_GetUserMediaTest

Powered by Google App Engine
This is Rietveld 408576698