From 321f4c12b428e24d6a59817e80aa36707aecd72f Mon Sep 17 00:00:00 2001
From: "jparent@chromium.org"
 <jparent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Thu, 25 Mar 2010 23:26:16 +0000
Subject: Make update_expecations_from_dashboard unit tests pass again. 1. Pass
 expecations into _get_iterable_expectations (this changed at some point and
 all usages weren't updated). 2. Change unit test expected results to strip
 out whitespace.  Code appearantly changed to strip whitespace at some point,
 which seems fine. 3. Change unit test expected results to include extra new
 lines.  This seems questionable, but we'll see if this is an issue in
 practice and address it then if it is.

TEST=Run update_expectations_from_dashboard_unittest.py
BUG=none

Review URL: http://codereview.chromium.org/1234002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42693 0039d316-1c4b-4281-b951-d872f2087c98
---
 .../update_expectations_from_dashboard.py          |  4 +--
 .../update_expectations_from_dashboard_unittest.py | 39 ++++++++++++----------
 2 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/webkit/tools/layout_tests/webkitpy/layout_tests/update_expectations_from_dashboard.py b/webkit/tools/layout_tests/webkitpy/layout_tests/update_expectations_from_dashboard.py
index dffc394..7068ae8 100644
--- a/webkit/tools/layout_tests/webkitpy/layout_tests/update_expectations_from_dashboard.py
+++ b/webkit/tools/layout_tests/webkitpy/layout_tests/update_expectations_from_dashboard.py
@@ -323,7 +323,7 @@ class ExpectationsUpdater(test_expectations.TestExpectationsFile):
         comment_lines = []
         removed_test_on_previous_line = False
         lineno = 0
-        for line in self._get_iterable_expectations():
+        for line in self._get_iterable_expectations(self._expectations):
             lineno += 1
             test, options, expectations = self.parse_expectations_line(line,
                                                                        lineno)
@@ -489,7 +489,7 @@ def main():
     updates = simplejson.load(open(sys.argv[1]))
 
     port_obj = get_port()
-    path_to_expectations = port_obj.path_to_expectations_file()
+    path_to_expectations = port_obj.path_to_test_expectations_file()
 
     old_expectations = open(path_to_expectations).read()
     new_expectations = update_expectations(port_obj, old_expectations, updates)
diff --git a/webkit/tools/layout_tests/webkitpy/layout_tests/update_expectations_from_dashboard_unittest.py b/webkit/tools/layout_tests/webkitpy/layout_tests/update_expectations_from_dashboard_unittest.py
index 034831c..a5b7e7a 100644
--- a/webkit/tools/layout_tests/webkitpy/layout_tests/update_expectations_from_dashboard_unittest.py
+++ b/webkit/tools/layout_tests/webkitpy/layout_tests/update_expectations_from_dashboard_unittest.py
@@ -29,7 +29,8 @@ class UpdateExpectationsUnittest(unittest.TestCase):
     BUG1 SLOW : 1.html = PASS
 
     BUG2 : 2.html = FAIL TIMEOUT
-    """
+    
+"""
 
         updates = []
         self.update_expectations(expectations, updates, exp_results)
@@ -73,8 +74,8 @@ class UpdateExpectationsUnittest(unittest.TestCase):
     def test_remove_expectation_from_one_platform(self):
         expectations = "BUG1 : 1.html = FAIL\n"
         expected_results = """BUG1 MAC WIN DEBUG : 1.html = FAIL
-    BUG1 RELEASE : 1.html = FAIL
-    """
+BUG1 RELEASE : 1.html = FAIL
+"""
         updates = {"1.html": {"LINUX DEBUG": {"extra": "FAIL"}}}
         self.update_expectations(expectations, updates, expected_results)
 
@@ -156,7 +157,7 @@ class UpdateExpectationsUnittest(unittest.TestCase):
         expectations = """BUG1 WIN : 1.html = FAIL
     BUG2 MAC : 1.html = FAIL"""
         expected_results = """BUG1 SLOW WIN : 1.html = FAIL
-    BUG2 MAC : 1.html = TIMEOUT\n"""
+BUG2 MAC : 1.html = TIMEOUT\n"""
         # TODO(ojan): Once we add currently unlisted tests, this expect results
         # for this test should be:
         #expected_results = """BUG1 SLOW WIN : 1.html = FAIL
@@ -186,10 +187,11 @@ class UpdateExpectationsUnittest(unittest.TestCase):
     BUG1 LINUX DEBUG : 1.html = TIMEOUT
     """
         expected_results = """BUG1 WIN RELEASE : 1.html = IMAGE+TEXT
-    BUG1 MAC RELEASE : 1.html = IMAGE
-    BUG1 LINUX RELEASE : 1.html = TEXT
-    BUG1 LINUX DEBUG : 1.html = TIMEOUT IMAGE+TEXT
-    """
+BUG1 MAC RELEASE : 1.html = IMAGE
+BUG1 LINUX RELEASE : 1.html = TEXT
+BUG1 LINUX DEBUG : 1.html = TIMEOUT IMAGE+TEXT
+    
+"""
         updates = {"1.html": {
             "WIN RELEASE": {"missing": "IMAGE+TEXT"},
             "MAC RELEASE": {"missing": "IMAGE"},
@@ -270,9 +272,9 @@ class UpdateExpectationsUnittest(unittest.TestCase):
         # all the same expectations.
         expectations = "BUG1 : 1.html = FAIL\n"
         expected_results = """BUG1 DEBUG : 1.html = FAIL TIMEOUT
-    BUG1 LINUX MAC RELEASE : 1.html = FAIL TIMEOUT
-    BUG1 WIN RELEASE : 1.html = FAIL CRASH
-    """
+BUG1 LINUX MAC RELEASE : 1.html = FAIL TIMEOUT
+BUG1 WIN RELEASE : 1.html = FAIL CRASH
+"""
         updates = {"1.html": {
             "WIN RELEASE": {"missing": "CRASH"},
             "WIN DEBUG": {"missing": "TIMEOUT"},
@@ -298,10 +300,11 @@ class UpdateExpectationsUnittest(unittest.TestCase):
 
     // Comment/whitespace after test should remain.
 
-    BUG2 MAC DEBUG : 2.html = TEXT
+BUG2 MAC DEBUG : 2.html = TEXT
 
     // Comment/whitespace at end of file should remain.
-    """
+    
+"""
         updates = {"2.html": {
             "WIN RELEASE": {"extra": "TEXT"},
             "MAC RELEASE": {"extra": "TEXT"}}}
@@ -316,9 +319,10 @@ class UpdateExpectationsUnittest(unittest.TestCase):
         expected_results = """BUG1 : 1.html = TIMEOUT
 
     // Comment/whitespace should remain.
-    BUG2 MAC DEBUG : 2.html = FAIL PASS
-    BUG2 LINUX MAC RELEASE : 2.html = FAIL PASS
-    """
+BUG2 MAC DEBUG : 2.html = FAIL PASS
+BUG2 LINUX MAC RELEASE : 2.html = FAIL PASS
+    
+"""
         updates = {"2.html": {
             "WIN RELEASE": {"extra": "FAIL"},
             "WIN DEBUG": {"extra": "FAIL"},
@@ -332,7 +336,8 @@ class UpdateExpectationsUnittest(unittest.TestCase):
     """
         expected_results = """// Comment/whitespace should remain.
     BUG2 : 1.html = IMAGE
-    """
+    
+"""
         updates = {"2.html": {"WIN RELEASE": {"extra": "TEXT"}}}
         self.update_expectations(expectations, updates, expected_results)
 
-- 
cgit v1.1