Web Inspector: AXI: expose selectedChildNodeIds of list boxes, tree controls, etc...
[WebKit-https.git] / Websites / test-results / public / api / failing-tests.php
index 0ee6691106a9ab3db1b096d9c4d49a04f534016b..603d22b8f97062d5f3df855935fdd38f508b5764 100644 (file)
@@ -5,20 +5,25 @@ require_once('../include/test-results.php');
 
 function main() {
     require_existence_of($_GET, array('builder' => '/^[A-Za-z0-9 \(\)\-_]+$/'));
-    $builder_name = $_GET['builder'];
+    $builder_param = $_GET['builder'];
 
     $db = connect();
-    $builder_row = $db->select_first_row('builders', NULL, array('name' => $builder_name));
-    if (!$builder_row)
-        exit_with_error('BuilderNotFound');
+    $builder_row = $db->select_first_row('builders', NULL, array('name' => $builder_param));
+    if (!$builder_row) {
+        $builder_row = $db->select_first_row('builders', NULL, array('id' => $builder_param));
+        if (!$builder_row)
+            exit_with_error('BuilderNotFound');
+    }
     $builder_id = $builder_row['id'];
 
     $generator = new ResultsJSONGenerator($db, $builder_id);
 
-    if ($generator->generate())
-        exit_with_success();
+    if (!$generator->generate('wrongexpectations'))
+        exit_with_error('ResultsWithWrongExpectationsNotFound', array('builderId' => $builder_id));
+    else if (!$generator->generate('flaky'))
+        exit_with_error('FlakyResultsNotFound', array('builderId' => $builder_id));
     else
-        exit_with_error('ResultsNotFound');
+        exit_with_success();
 }
 
 main();