153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# Copyright (C) 2013 Google Inc. All rights reserved.
253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#
353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# Redistribution and use in source and binary forms, with or without
453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# modification, are permitted provided that the following conditions are
553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# met:
653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#
753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#     * Redistributions of source code must retain the above copyright
853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# notice, this list of conditions and the following disclaimer.
953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#     * Redistributions in binary form must reproduce the above
1053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# copyright notice, this list of conditions and the following disclaimer
1153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# in the documentation and/or other materials provided with the
1253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# distribution.
1353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#     * Neither the name of Google Inc. nor the names of its
1453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# contributors may be used to endorse or promote products derived from
1553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# this software without specific prior written permission.
1653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#
1753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
2953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)import logging
30e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)import unittest
3153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
3253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)from webkitpy.common.host_mock import MockHost
3353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)from webkitpy.common.checkout.scm.scm_mock import MockSCM
3453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)from webkitpy.common.system.filesystem_mock import MockFileSystem
3553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)from webkitpy.layout_tests.layout_tests_mover import LayoutTestsMover
361e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)from webkitpy.layout_tests.port import base
3753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
3853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
391e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)class MockPort(base.Port):
4053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
4153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def __init__(self, **kwargs):
4253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        # This sets up a mock FileSystem and SCM using that FileSystem.
4353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host = MockHost()
441e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)        super(MockPort, self).__init__(host, host.port_factory.all_port_names()[0], **kwargs)
4553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
4653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host.filesystem.maybe_make_directory(self._absolute_path('platform'))
4753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host.filesystem.maybe_make_directory(self._absolute_path('existing_directory'))
4853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host.filesystem.write_text_file(self._absolute_path('existing_file.txt'), '')
497242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci        host.filesystem.write_text_file(self._absolute_path('VirtualTestSuites'), '[]')
5053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host.filesystem.write_text_file(self._absolute_path('TestExpectations'), """
5153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)crbug.com/42 [ Debug ] origin/path/test.html [ Pass Timeout Failure ]
5253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)crbug.com/42 [ Win ] origin/path [ Slow ]
5353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)crbug.com/42 [ Release ] origin [ Crash ]
5453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)""")
5553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host.filesystem.write_text_file(self._absolute_path('existing_directory_with_contents', 'test.html'), '')
5653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host.filesystem.write_text_file(self._absolute_path('origin', 'path', 'test.html'), """
5753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)<script src="local_script.js">
5853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)<script src="../../unmoved/remote_script.js">
59e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)<script src='../../unmoved/remote_script_single_quotes.js'>
6053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)<script href="../../unmoved/remote_script.js">
61e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)<script href='../../unmoved/remote_script_single_quotes.js'>
62e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)<script href="">
6353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)""")
6453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host.filesystem.write_text_file(self._absolute_path('origin', 'path', 'test.css'), """
6553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)url('../../unmoved/url_function.js')
66e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)url("../../unmoved/url_function_double_quotes.js")
67e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)url(../../unmoved/url_function_no_quotes.js)
68e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)url('')
69e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)url()
7053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)""")
7153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host.filesystem.write_text_file(self._absolute_path('origin', 'path', 'test.js'), """
7253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)importScripts('../../unmoved/import_scripts_function.js')
73e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)importScripts("../../unmoved/import_scripts_function_double_quotes.js")
74e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)importScripts('')
7553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)""")
7653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        host.filesystem.write_text_file(self._absolute_path('unmoved', 'test.html'), """
7753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)<script src="local_script.js">
7853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)<script src="../origin/path/remote_script.js">
7953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)""")
8053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def _absolute_path(self, *paths):
8253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        return self.host.scm().absolute_path('LayoutTests', *paths)
8353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def layout_tests_dir(self):
8553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        return self._absolute_path()
8653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class LayoutTestsMoverTest(unittest.TestCase):
8953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
9053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def setUp(self):
9153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        port = MockPort()
9253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._port = port
9353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._filesystem = self._port.host.filesystem
9453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover = LayoutTestsMover(port=self._port)
9553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
9653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_non_existent_origin_raises(self):
9753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertRaises(Exception, self._mover.move, 'non_existent', 'destination')
9853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
9953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_origin_outside_layout_tests_directory_raises(self):
10053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertRaises(Exception, self._mover.move, '../outside', 'destination')
10153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
10253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_file_destination_raises(self):
10353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertRaises(Exception, self._mover.move, 'origin/path', 'existing_file.txt')
10453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
10553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_destination_outside_layout_tests_directory_raises(self):
10653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertRaises(Exception, self._mover.move, 'origin/path', '../outside')
10753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
10853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_basic_operation(self):
10953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
11053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertFalse(self._filesystem.exists(self._port._absolute_path('origin/path')))
11153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue(self._filesystem.isfile(self._port._absolute_path('destination/test.html')))
11253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
11353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_move_to_existing_directory(self):
11453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'existing_directory')
11553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertFalse(self._filesystem.exists(self._port._absolute_path('origin', 'path')))
11653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue(self._filesystem.isfile(self._port._absolute_path('existing_directory', 'test.html')))
11753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
11853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_collision_in_existing_directory_raises(self):
11953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertRaises(Exception, self._mover.move, 'origin/path', 'existing_directory_with_contents')
12053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
12153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_move_to_layout_tests_root(self):
12253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', '')
12353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertFalse(self._filesystem.exists(self._port._absolute_path('origin', 'path')))
12453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue(self._filesystem.isfile(self._port._absolute_path('test.html')))
12553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
12653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_moved_reference_in_moved_file_not_updated(self):
12753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
12853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('src="local_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
12953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
13053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_unmoved_reference_in_unmoved_file_not_updated(self):
13153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
13253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('src="local_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('unmoved', 'test.html')))
13353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
13453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_moved_reference_in_unmoved_file_is_updated(self):
13553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
13653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('src="../destination/remote_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('unmoved', 'test.html')))
13753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
13853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_unmoved_reference_in_moved_file_is_updated(self):
13953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
14053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('src="../unmoved/remote_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
141e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)
142e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)    def test_references_in_html_file_are_updated(self):
143e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
144e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('src="../unmoved/remote_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
145e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('src=\'../unmoved/remote_script_single_quotes.js\'' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
14653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('href="../unmoved/remote_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
147e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('href=\'../unmoved/remote_script_single_quotes.js\'' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
148e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('href=""' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
14953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
150e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)    def test_references_in_css_file_are_updated(self):
15153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
15253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('url(\'../unmoved/url_function.js\')' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.css')))
153e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('url("../unmoved/url_function_double_quotes.js")' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.css')))
154e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('url(../unmoved/url_function_no_quotes.js)' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.css')))
155e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('url(\'\')' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.css')))
156e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('url()' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.css')))
15753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
158e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)    def test_references_in_javascript_file_are_updated(self):
15953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
16053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('importScripts(\'../unmoved/import_scripts_function.js\')' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.js')))
161e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('importScripts("../unmoved/import_scripts_function_double_quotes.js")' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.js')))
162e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        self.assertTrue('importScripts(\'\')' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.js')))
16353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
16453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_expectation_is_updated(self):
16553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
16653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertFalse('origin/path/test.html' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
16753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('crbug.com/42 [ Debug ] destination/test.html [ Pass Timeout Failure ]'
16853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)                        in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
16953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
17053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_directory_expectation_is_updated(self):
17153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
17253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertFalse('origin/path' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
17353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('crbug.com/42 [ Win ] destination [ Slow ]' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
17453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
17553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    def test_expectation_is_added_when_subdirectory_moved(self):
17653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self._mover.move('origin/path', 'destination')
17753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('crbug.com/42 [ Release ] origin [ Crash ]' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
17853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        self.assertTrue('crbug.com/42 [ Release ] destination [ Crash ]' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
179