Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py

Issue 2143123004: Access environment variables through Host object instead of directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and updated after change for dummy home dir on linux. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py
index a0a8d788fd48a3536b76f0e3f7ef0f06fc377e6d..89ef5ff257aed9f068ed7488db050fce4505e89a 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py
@@ -26,8 +26,6 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import os
-
from webkitpy.common.system import outputcapture
from webkitpy.common.system.executive_mock import MockExecutive
from webkitpy.common.system.filesystem_mock import MockFileSystem
@@ -47,11 +45,10 @@ class WinPortTest(port_testcase.PortTestCase):
port = self.make_port()
port._executive = MockExecutive(should_log=True)
output = outputcapture.OutputCapture()
- # FIXME: This test should not use the real os.environ
- orig_environ = os.environ.copy()
+ orig_environ = port.host.environ.copy()
env = output.assert_outputs(self, port.setup_environ_for_server)
- self.assertEqual(orig_environ["PATH"], os.environ["PATH"])
- self.assertNotEqual(env["PATH"], os.environ["PATH"])
+ self.assertEqual(orig_environ["PATH"], port.host.environ.get("PATH"))
+ self.assertNotEqual(env["PATH"], port.host.environ.get("PATH"))
def test_setup_environ_for_server_cygpath(self):
port = self.make_port()

Powered by Google App Engine
This is Rietveld 408576698