Collect system tray screenshots.

We are collecting system tray screenshots so that we can observe
how the system tray looks like in the lab.

We eventually intend to use image comparison based to tests to detect
basic rendering flaws in the system tray.

However, it is difficult to establish a baseline with tray as we don't
know a good state that the tray starts in.

This test won't fail, but it will give us the ability to look at the system
tray across many builds.

** Moved pixel measurements to be inputs from control file. Renamed control file accordingly.

** capitalized and moved out of class declaration variables that are meant
to be constants indicating that they are not meant to be changed.

** Added dependencies flag in the control file to point to the link board.
Consequently, removed code to throw on other boards.

** We will only run this test on link for now. But we need to investigate
the possibility of specifying exactly which boards we are interested in.

BUG=chromium:374981
TEST=ran a local test on link and opened biopic link to see the image.

Change-Id: Ifa2591604d019efe8539c061a32d4a0b24505f8a
Reviewed-on: https://chromium-review.googlesource.com/202825
Reviewed-by: Kris Rambish <krisr@chromium.org>
Reviewed-by: Rohit Makasana <rohitbm@chromium.org>
Commit-Queue: Rohit Makasana <rohitbm@chromium.org>
Tested-by: Rohit Makasana <rohitbm@chromium.org>
diff --git a/client/site_tests/ui_SystemTray/control.link b/client/site_tests/ui_SystemTray/control.link
new file mode 100644
index 0000000..df1f457
--- /dev/null
+++ b/client/site_tests/ui_SystemTray/control.link
@@ -0,0 +1,29 @@
+# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+AUTHOR = "Mussa Kiroga"
+NAME = "ui_SystemTray"
+PURPOSE = "Collects system tray images as data to examine default icons"
+CRITERIA = """
+
+"""
+SUITE = "ui"
+TIME = "SHORT"
+TEST_CATEGORY = "General"
+TEST_CLASS = "ui"
+TEST_TYPE = "client"
+DEPENDENCIES = "board:link"
+
+DOC = """
+This test collects system tray images of different devices. The goal is collect
+data that helps us understand how system tray looks in the lab for purposes of
+establishing some sort of a control/reference behavior.
+
+All images will be uploaded to biopic and examined via biopic web interface.
+"""
+
+job.run_test('ui_SystemTray',
+              shelf_height = 100,
+              x_offset_in_pixels = 2000,
+              y_offset_in_pixels = 1600)
diff --git a/client/site_tests/ui_SystemTray/ui_SystemTray.py b/client/site_tests/ui_SystemTray/ui_SystemTray.py
new file mode 100644
index 0000000..2e7833a
--- /dev/null
+++ b/client/site_tests/ui_SystemTray/ui_SystemTray.py
@@ -0,0 +1,57 @@
+# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os, time
+
+
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import file_utils
+from autotest_lib.client.cros.video import bp_image_comparer
+
+
+WORKING_DIR = '/tmp/test'
+BIOPIC_PROJECT_NAME = 'chromeos.test.desktopui.systemtray.private'
+
+# TODO: Set up an alias so that anyone can monitor results.
+BIOPIC_CONTACT_EMAIL = 'mussa@google.com'
+BIOPIC_TIMEOUT_S = 1
+
+
+class ui_SystemTray(test.test):
+
+    # Comply with autotest requiring 'version' attribute
+    version = 2
+
+    def run_once(self, shelf_height, x_offset_in_pixels, y_offset_in_pixels):
+        """
+        Runs the test.
+        """
+
+        file_utils.make_leaf_dir(WORKING_DIR)
+
+        timestamp = time.strftime('%Y_%m_%d_%H%M', time.localtime())
+
+        filename = '%s_%s_%s.png' % (timestamp,
+                                     utils.get_current_board(),
+                                     utils.get_chromeos_release_version())
+
+        filepath = os.path.join(WORKING_DIR, filename)
+
+        utils.take_screen_shot_crop_by_height(filepath,
+                                              shelf_height,
+                                              x_offset_in_pixels,
+                                              y_offset_in_pixels)
+
+        with bp_image_comparer.BpImageComparer(BIOPIC_PROJECT_NAME,
+                                               BIOPIC_CONTACT_EMAIL,
+                                               BIOPIC_TIMEOUT_S) as comparer:
+            # We just care about storing these images for we can look at them
+            # later. We don't wish to compare images right now.
+            # Make reference images same as test image!
+            comparer.compare(filepath, filepath)
+
+        file_utils.rm_dir_if_exists(WORKING_DIR)
+
+
+