Do not ask user to press Fail button if pixmap to texture test fails because GLX is older than 1.3.

Review URL: http://codereview.chromium.org/2031007
diff --git a/client/deps/glbench/src/teartest.cc b/client/deps/glbench/src/teartest.cc
index b8e4677..d801d55 100644
--- a/client/deps/glbench/src/teartest.cc
+++ b/client/deps/glbench/src/teartest.cc
@@ -215,13 +215,16 @@
   std::vector<std::string> tests;
   SplitString(FLAGS_tests, ',', &tests);
 
+  int return_code = 0;
   for (std::vector<std::string>::iterator it = tests.begin();
        it != tests.end();
        it++)
   {
     Test* t = test_map[*it];
-    if (!t || !t->Start())
+    if (!t || !t->Start()) {
+      return_code = 1;
       continue;
+    }
 
     Bool got_event = False;
     uint64_t wait_until = GetUTime() + 1000000ULL * FLAGS_seconds_to_run;
@@ -253,5 +256,5 @@
 
   glDeleteTextures(1, &texture);
   DestroyContext();
-  return 0;
+  return return_code;
 }
diff --git a/client/deps/glbench/src/teartest_glx.cc b/client/deps/glbench/src/teartest_glx.cc
index 27f5767..86917f2 100644
--- a/client/deps/glbench/src/teartest_glx.cc
+++ b/client/deps/glbench/src/teartest_glx.cc
@@ -43,8 +43,10 @@
   if (!glXQueryVersion(g_xlib_display, &major, &minor))
     return false;
 
-  if (major < 1 || (major == 1 && minor < 3))
+  if (major < 1 || (major == 1 && minor < 3)) {
+    printf("# GLX 1.3 required for pixmap to texture extension.\n");
     return false;
+  }
 
   if (!glXBindTexImageEXT)
     return false;
diff --git a/client/site_tests/graphics_TearTest/graphics_TearTest.py b/client/site_tests/graphics_TearTest/graphics_TearTest.py
index fa3ccd8..3e8cb04 100644
--- a/client/site_tests/graphics_TearTest/graphics_TearTest.py
+++ b/client/site_tests/graphics_TearTest/graphics_TearTest.py
@@ -61,14 +61,18 @@
             for test in tests:
                 cmd = test['cmd']
                 logging.info("command launched: %s" % cmd)
-                utils.system(site_ui.xcommand(cmd))
+                ret = utils.system(site_ui.xcommand(cmd), ignore_status=True)
 
-                test['result'] = html_button('Pass') + html_button('Fail')
-                dialog = site_ui.Dialog(question=TEMPLATE.format(header, tests),
-                                        choices=[])
-                # Store user's response if the testcase passed or failed.
-                result = dialog.get_result()
-                test['result'] = result if result else 'Timeout'
+                if ret == 0:
+                    test['result'] = html_button('Pass') + html_button('Fail')
+                    dialog = site_ui.Dialog(
+                        question=TEMPLATE.format(header, tests), choices=[])
+                    # Store user's response if the testcase passed or failed.
+                    result = dialog.get_result()
+                    test['result'] = result if result else 'Timeout'
+                else:
+                    # If test return nonzero status, mark it as failed.
+                    test['result'] = 'Fail'
 
             # Test passed if all testcases passed.
             passed = all(test['result'] == 'Pass' for test in tests)