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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/temporary_http_server_unittest.py

Issue 10916227: More polish in prep for CrOS support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for landing Created 8 years, 3 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: tools/chrome_remote_control/chrome_remote_control/temporary_http_server_unittest.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/temporary_http_server_unittest.py b/tools/chrome_remote_control/chrome_remote_control/temporary_http_server_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..61d508cf9110c64a493b80c74ef6ce9a2033adf8
--- /dev/null
+++ b/tools/chrome_remote_control/chrome_remote_control/temporary_http_server_unittest.py
@@ -0,0 +1,28 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import os
+import unittest
+import urllib2
+import urlparse
+
+import browser_finder
+import browser_options
+import temporary_http_server
+
+class TemporaryHTTPServerTest(unittest.TestCase):
+ def testBasicHosting(self):
+ unittest_data_dir = os.path.join(os.path.dirname(__file__),
+ "..", "unittest_data")
+ options = browser_options.options_for_unittests
+ browser_to_create = browser_finder.FindBrowser(options)
+ with browser_to_create.Create() as b:
+ with b.CreateTemporaryHTTPServer(unittest_data_dir) as s:
+ with b.ConnectToNthTab(0) as t:
+ t.page.Navigate(s.UrlOf("/blank.html"))
+ t.WaitForDocumentReadyStateToBeComplete()
+ x = t.runtime.Evaluate("document.body.innerHTML")
+ x = x.strip()
+
+ self.assertEquals(x, "Hello world")
+

Powered by Google App Engine
This is Rietveld 408576698