michael@0: package org.mozilla.gecko.tests; michael@0: michael@0: import org.json.JSONObject; michael@0: import org.mozilla.gecko.PaintedSurface; michael@0: michael@0: import android.os.Build; michael@0: michael@0: /** michael@0: * Tests that Flash is working michael@0: * - loads a page containing a Flash plugin michael@0: * - verifies it rendered properly michael@0: */ michael@0: public class testAdobeFlash extends PixelTest { michael@0: public void testLoad() { michael@0: // This test only works on ICS and higher michael@0: if (Build.VERSION.SDK_INT < 15) { michael@0: blockForGeckoReady(); michael@0: return; michael@0: } michael@0: michael@0: // Enable plugins michael@0: JSONObject jsonPref = new JSONObject(); michael@0: try { michael@0: jsonPref.put("name", "plugin.enable"); michael@0: jsonPref.put("type", "string"); michael@0: jsonPref.put("value", "1"); michael@0: setPreferenceAndWaitForChange(jsonPref); michael@0: } catch (Exception ex) { michael@0: mAsserter.ok(false, "exception in testAdobeFlash", ex.toString()); michael@0: } michael@0: michael@0: blockForGeckoReady(); michael@0: michael@0: String url = getAbsoluteUrl(StringHelper.ROBOCOP_ADOBE_FLASH_URL); michael@0: PaintedSurface painted = loadAndGetPainted(url); michael@0: michael@0: mAsserter.ispixel(painted.getPixelAt(0, 0), 0, 0xff, 0, "Pixel at 0, 0"); michael@0: mAsserter.ispixel(painted.getPixelAt(50, 50), 0, 0xff, 0, "Pixel at 50, 50"); michael@0: mAsserter.ispixel(painted.getPixelAt(101, 0), 0xff, 0xff, 0xff, "Pixel at 101, 0"); michael@0: mAsserter.ispixel(painted.getPixelAt(0, 101), 0xff, 0xff, 0xff, "Pixel at 0, 101"); michael@0: michael@0: } michael@0: }