New issue
Advanced search Search tips

Issue 604437 link

Starred by 1 user

Issue metadata

Status: Verified
Owner: ----
Closed: May 2016
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Multiple platforms failing policy_ImagesAllowedForUrls and policy_ImagesBlockedForUrls autotests.

Project Member Reported by juanra...@chromium.org, Apr 18 2016

Issue description

Status: Started (was: Assigned)
AutoTest test policy_ImagesAllowedForUrls fails in two cases (2Urls, NotSet) with "FAIL: Image should be blocked".  (cases 1Url and 3Urls PASS, since they both expect the image to appear).

AutoTest test policy_ImagesBlockedForUrls fails in two cases (1Url, 3Urls) with "FAIL: Image should be blocked". Cases NotSet and 2Urls PASS, since they both expect the image to appear).

The breakage in the test appears to be due to a change in Chrome that renders a blocked image as a small "broken image" gif, and the name of the image file.  The proposed fix is to change the image detection method to check for a size less than the expected image.

While I'm in there making these changes, there are some other changes to be made to bring these two tests up to the modern era:
1) Let base class handle self._web_server initialization and cleanup. See how policy_EditBookmarksEnabled does it.
2) In run_test_case, use the more generic method of setting policy_value and policies_dict. Again, see policy_EditBookmarksEnabled.
3) Let base class handle run_once(). See policy_EditBookmarksEnabled.

Comment 2 Deleted

Summary: Multiple platforms failing policy_ImagesAllowedForUrls and policy_ImagesBlockedForUrls autotests. (was: platforms failing autotests)
Also: Update the policy_ImagesAllowedForUrls test case names to:
NotSet_Blocked, 1URL_Allowed, 2Urls_Blocked, 3Urls_Allowed

Update the policy_ImagesBlockedForUrls test case names to:
NotSet_Allowed, 1Url_Blocked, 2Urls_Allowed, 3Urls_Blocked
Project Member

Comment 5 by bugdroid1@chromium.org, May 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/7f36f732262b7e4ab4f2e1950fd129c91f877a8f

commit 7f36f732262b7e4ab4f2e1950fd129c91f877a8f
Author: Scott Cunningham <scunningham@chromium.org>
Date: Wed May 04 22:20:08 2016

Fix ImagesAllowedForUrls and ImagesBlockedForUrls failures.

The policy_ImagesAllowedForUrls and policy_ImagesBlockedForUrls tests
began failing when Chrome started showing a broken-image gif for
blocked images, rather than a blank box.

This fix checks to see wether the displayed image is less than the
minimum expected size of the image (of some cute kittens), to determine
that the image was blocked.

The fix also updates the tests to take advantage of newer methods
in the base class.

BUG= chromium:604437 
TEST=Run test_that <IP> policy_ImagesAllowedForUrls and
policy_ImagesBlockedForUrls

Change-Id: If424db9d476feae9cbadf4807737aea42a9d1433
Reviewed-on: https://chromium-review.googlesource.com/342575
Commit-Ready: Scott Cunningham <scunningham@chromium.org>
Tested-by: Scott Cunningham <scunningham@chromium.org>
Reviewed-by: Krishna Gavini <krishnargv@chromium.org>

[modify] https://crrev.com/7f36f732262b7e4ab4f2e1950fd129c91f877a8f/client/site_tests/policy_ImagesBlockedForUrls/policy_ImagesBlockedForUrls.py
[modify] https://crrev.com/7f36f732262b7e4ab4f2e1950fd129c91f877a8f/client/cros/enterprise_policy_base.py
[modify] https://crrev.com/7f36f732262b7e4ab4f2e1950fd129c91f877a8f/client/site_tests/policy_ImagesAllowedForUrls/control
[modify] https://crrev.com/7f36f732262b7e4ab4f2e1950fd129c91f877a8f/client/site_tests/policy_ImagesAllowedForUrls/policy_ImagesAllowedForUrls.py
[modify] https://crrev.com/7f36f732262b7e4ab4f2e1950fd129c91f877a8f/client/site_tests/policy_ImagesBlockedForUrls/control

Status: Fixed (was: Started)
Bulk verified
Status: Verified (was: Fixed)
bulk verified
Owner: ----

Sign in to add a comment