Bug 883921 - Make testFindInPage close PaintedSurface. r=gbrown

--HG--
extra : rebase_source : 9531f3c74e01edb1fad635f9ced333362daed527
This commit is contained in:
Nick Alexander 2013-06-17 13:57:04 -07:00
parent 416a9a74b1
commit 071b157add

View File

@ -27,14 +27,22 @@ public class testFindInPage extends PixelTest {
findText("Robocoop", 3); // This will be close enough to existing text to test that search finds just what it should
PaintedSurface painted = waitForPaint(paintExpecter);
paintExpecter.unregisterListener();
mAsserter.ispixel(painted.getPixelAt(width,height), 255, 0, 0, "Pixel at " + String.valueOf(width) + "," + String.valueOf(height));
try {
mAsserter.ispixel(painted.getPixelAt(width,height), 255, 0, 0, "Pixel at " + String.valueOf(width) + "," + String.valueOf(height));
} finally {
painted.close();
}
// Search that finds matches and therefor pans the page
paintExpecter = mActions.expectPaint();
findText("Robocop", 3);
painted = waitForPaint(paintExpecter);
paintExpecter.unregisterListener();
mAsserter.isnotpixel(painted.getPixelAt(width,height), 255, 0, 0, "Pixel at " + String.valueOf(width) + "," + String.valueOf(height));
try {
mAsserter.isnotpixel(painted.getPixelAt(width,height), 255, 0, 0, "Pixel at " + String.valueOf(width) + "," + String.valueOf(height));
} finally {
painted.close();
}
}
public void findText(String text, int nrOfMatches){