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

Unified Diff: content/browser/renderer_host/render_widget_host_view_browsertest.cc

Issue 116893004: Parameterize the composited RenderWidgetHostViewBrowserTests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests: android Created 7 years 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
« no previous file with comments | « no previous file | content/public/test/browser_test_base.h » ('j') | content/public/test/browser_test_base.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_browsertest.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc
index 60172d38635d2002b01410e5a2e3112c3bfad258..896cf4728eda1825cc236805a5795d96ba8386a6 100644
--- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc
@@ -211,17 +211,35 @@ class RenderWidgetHostViewBrowserTest : public ContentBrowserTest {
int frames_captured_;
};
+enum CompositingMode {
+ GL_COMPOSITING,
+ SOFTWARE_COMPOSITING,
+};
+
class CompositingRenderWidgetHostViewBrowserTest
- : public RenderWidgetHostViewBrowserTest {
+ : public RenderWidgetHostViewBrowserTest,
+ public testing::WithParamInterface<CompositingMode> {
public:
+ explicit CompositingRenderWidgetHostViewBrowserTest()
+ : compositing_mode_(GetParam()) {
+#if !defined(USE_AURA) && !defined(OS_MACOSX)
+ // TODO(danakj): Remove when GTK linux is no more.
+ compositing_mode_ = GL_COMPOSITING;
sky 2013/12/19 21:35:32 Wouldn't this be better placed around INSTANTIATE_
danakj 2013/12/19 21:40:54 Hm! Never heard of such a thing, I'll go look it u
danakj 2013/12/19 21:45:31 Oh, I see what you mean, the INSTANTIATE thing at
danakj 2013/12/19 22:21:06 Done.
+#endif
+ }
+
virtual void SetUp() OVERRIDE {
- // We expect real pixel output for these tests.
- UseRealGLContexts();
+ if (compositing_mode_ == SOFTWARE_COMPOSITING) {
+ UseSoftwareCompositing();
+ } else {
+ // We expect real pixel output for these tests.
+ UseRealGLContexts();
- // On legacy windows, these tests need real GL bindings to pass.
#if defined(OS_WIN) && !defined(USE_AURA)
- UseRealGLBindings();
+ // On legacy windows, these tests need real GL bindings to pass.
+ UseRealGLBindings();
#endif
+ }
RenderWidgetHostViewBrowserTest::SetUp();
}
@@ -268,6 +286,8 @@ class CompositingRenderWidgetHostViewBrowserTest
WaitForCopySourceReady();
return true;
}
+
+ CompositingMode compositing_mode_;
sky 2013/12/19 21:35:32 const and private and DISALLOW_...?
danakj 2013/12/19 21:40:54 Sure, leaky encapsulation in test fixtures has bec
danakj 2013/12/19 22:21:06 Done.
};
class NonCompositingRenderWidgetHostViewBrowserTest
@@ -342,7 +362,7 @@ class FakeFrameSubscriber : public RenderWidgetHostViewFrameSubscriber {
// The CopyFromBackingStore() API should work on all platforms when compositing
// is enabled.
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest,
CopyFromBackingStore) {
RunBasicCopyFromBackingStoreTest();
}
@@ -356,7 +376,7 @@ IN_PROC_BROWSER_TEST_F(NonCompositingRenderWidgetHostViewBrowserTest,
// Tests that the callback passed to CopyFromBackingStore is always called,
// even when the RenderWidgetHost is deleting in the middle of an async copy.
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest,
CopyFromBackingStore_CallbackDespiteDelete) {
SET_UP_SURFACE_OR_PASS_TEST(NULL);
@@ -386,7 +406,7 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest,
#define MAYBE_CopyFromCompositingSurface_CallbackDespiteDelete \
CopyFromCompositingSurface_CallbackDespiteDelete
#endif
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest,
MAYBE_CopyFromCompositingSurface_CallbackDespiteDelete) {
SET_UP_SURFACE_OR_PASS_TEST(NULL);
RenderWidgetHostViewPort* const view = GetRenderWidgetHostViewPort();
@@ -421,7 +441,7 @@ IN_PROC_BROWSER_TEST_F(NonCompositingRenderWidgetHostViewBrowserTest,
// Test basic frame subscription functionality. We subscribe, and then run
// until at least one DeliverFrameCallback has been invoked.
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest,
FrameSubscriberTest) {
SET_UP_SURFACE_OR_PASS_TEST(NULL);
RenderWidgetHostViewPort* const view = GetRenderWidgetHostViewPort();
@@ -447,7 +467,7 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest,
}
// Test that we can copy twice from an accelerated composited page.
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTest, CopyTwice) {
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest, CopyTwice) {
SET_UP_SURFACE_OR_PASS_TEST(NULL);
RenderWidgetHostViewPort* const view = GetRenderWidgetHostViewPort();
if (!view->CanCopyToVideoFrame()) {
@@ -753,7 +773,7 @@ class CompositingRenderWidgetHostViewBrowserTestTabCapture
std::string test_url_;
};
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTestTabCapture,
CopyFromCompositingSurface_Origin_Unscaled) {
gfx::Rect copy_rect(400, 300);
gfx::Size output_size = copy_rect.size();
@@ -767,7 +787,7 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
video_frame);
}
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTestTabCapture,
CopyFromCompositingSurface_Origin_Scaled) {
gfx::Rect copy_rect(400, 300);
gfx::Size output_size(200, 100);
@@ -781,7 +801,7 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
video_frame);
}
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTestTabCapture,
CopyFromCompositingSurface_Cropped_Unscaled) {
// Grab 60x60 pixels from the center of the tab contents.
gfx::Rect copy_rect(400, 300);
@@ -798,7 +818,7 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
video_frame);
}
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTestTabCapture,
CopyFromCompositingSurface_Cropped_Scaled) {
// Grab 60x60 pixels from the center of the tab contents.
gfx::Rect copy_rect(400, 300);
@@ -815,7 +835,7 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
video_frame);
}
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTestTabCapture,
CopyFromCompositingSurface_ForVideoFrame) {
// Grab 90x60 pixels from the center of the tab contents.
gfx::Rect copy_rect(400, 300);
@@ -832,7 +852,7 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
video_frame);
}
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTestTabCapture,
CopyFromCompositingSurface_ForVideoFrame_Scaled) {
// Grab 90x60 pixels from the center of the tab contents.
gfx::Rect copy_rect(400, 300);
@@ -853,9 +873,7 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewBrowserTestTabCapture,
class CompositingRenderWidgetHostViewTabCaptureHighDPI
: public CompositingRenderWidgetHostViewBrowserTestTabCapture {
public:
- CompositingRenderWidgetHostViewTabCaptureHighDPI()
- : kScale(2.f) {
- }
+ CompositingRenderWidgetHostViewTabCaptureHighDPI() : kScale(2.f) {}
virtual void SetUpCommandLine(CommandLine* cmd) OVERRIDE {
CompositingRenderWidgetHostViewBrowserTestTabCapture::SetUpCommandLine(cmd);
@@ -880,7 +898,7 @@ class CompositingRenderWidgetHostViewTabCaptureHighDPI
DISALLOW_COPY_AND_ASSIGN(CompositingRenderWidgetHostViewTabCaptureHighDPI);
};
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewTabCaptureHighDPI,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewTabCaptureHighDPI,
CopyFromCompositingSurface) {
gfx::Rect copy_rect(200, 150);
gfx::Size output_size = copy_rect.size();
@@ -895,7 +913,7 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewTabCaptureHighDPI,
video_frame);
}
-IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewTabCaptureHighDPI,
+IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewTabCaptureHighDPI,
CopyFromCompositingSurfaceVideoFrame) {
gfx::Size html_rect_size(200, 150);
// Grab 90x60 pixels from the center of the tab contents.
@@ -913,6 +931,16 @@ IN_PROC_BROWSER_TEST_F(CompositingRenderWidgetHostViewTabCaptureHighDPI,
video_frame);
}
+INSTANTIATE_TEST_CASE_P(GLAndSoftware,
+ CompositingRenderWidgetHostViewBrowserTest,
+ testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING));
+INSTANTIATE_TEST_CASE_P(GLAndSoftware,
+ CompositingRenderWidgetHostViewBrowserTestTabCapture,
+ testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING));
+INSTANTIATE_TEST_CASE_P(GLAndSoftware,
+ CompositingRenderWidgetHostViewTabCaptureHighDPI,
+ testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING));
+
#endif // !defined(OS_ANDROID) && !defined(OS_IOS)
} // namespace
« no previous file with comments | « no previous file | content/public/test/browser_test_base.h » ('j') | content/public/test/browser_test_base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698