Revert "ANGLETest::SetUp: resize the window only if needed."
Going to try reverting this as a potential fix to failures seen on the bots. Can re-land in the morning if the failures don't clear up.
Failures seen on all windows bots now.
This reverts commit 15ca829680f81b26dfbcb59e9d53554cb1b29395.
Change-Id: Ic2904e00e8d53b2cc8939b36953f47f131c5e6c2
Reviewed-on: https://chromium-review.googlesource.com/287846
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/tests/test_utils/ANGLETest.cpp b/src/tests/test_utils/ANGLETest.cpp
index 3a1c77f..2e6fdbd 100644
--- a/src/tests/test_utils/ANGLETest.cpp
+++ b/src/tests/test_utils/ANGLETest.cpp
@@ -17,28 +17,25 @@
void ANGLETest::SetUp()
{
+ if (!ResizeWindow(mWidth, mHeight))
+ {
+ FAIL() << "Failed to resize ANGLE test window.";
+ }
+
if (!createEGLContext())
{
FAIL() << "egl context creation failed.";
}
- if (mOSWindow->getWidth() != mWidth || mOSWindow->getHeight() != mHeight)
- {
- if (!mOSWindow->resize(mWidth, mHeight))
- {
- FAIL() << "Failed to resize ANGLE test window.";
- }
+ // Swap the buffers so that the default framebuffer picks up the resize
+ // which will allow follow-up test code to assume the framebuffer covers
+ // the whole window.
+ swapBuffers();
- // Swap the buffers so that the default framebuffer picks up the resize
- // which will allow follow-up test code to assume the framebuffer covers
- // the whole window.
- swapBuffers();
-
- // This Viewport command is not strictly necessary but we add it so that programs
- // taking OpenGL traces can guess the size of the default framebuffer and show it
- // in their UIs
- glViewport(0, 0, mWidth, mHeight);
- }
+ // This Viewport command is not strictly necessary but we add it so that programs
+ // taking OpenGL traces can guess the size of the default framebuffer and show it
+ // in their UIs
+ glViewport(0, 0, mWidth, mHeight);
}
void ANGLETest::TearDown()
@@ -253,6 +250,11 @@
return true;
}
+bool ANGLETest::ResizeWindow(int width, int height)
+{
+ return mOSWindow->resize(width, height);
+}
+
void ANGLETest::SetWindowVisible(bool isVisible)
{
mOSWindow->setVisible(isVisible);