Bug 811747: Adding a test for checking that page_source handles unicode chars; r=jgriffin
authorDavid Burns <dburns@mozilla.com>
Wed, 09 Jan 2013 14:32:54 +0000
changeset 199716 ff9d5d0bde0af0eae48257ae1b3b6f6b92f97a17
parent 199715 59d2341b206a9aef08d508e6763094a309bf4507
child 199717 f09a01f7050c1b4806b914ddbd750f83a3799991
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs811747
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 811747: Adding a test for checking that page_source handles unicode chars; r=jgriffin
testing/marionette/client/marionette/tests/unit/test_pagesource.py
testing/marionette/client/marionette/tests/unit/unit-tests.ini
testing/marionette/client/marionette/www/testPageSourceWithUnicodeChars.html
--- a/testing/marionette/client/marionette/tests/unit/test_pagesource.py
+++ b/testing/marionette/client/marionette/tests/unit/test_pagesource.py
@@ -1,29 +1,36 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette_test import MarionetteTestCase, skip_if_b2g
 
 class TestPageSource(MarionetteTestCase):
     def testShouldReturnTheSourceOfAPage(self):
         test_html = self.marionette.absolute_url("testPageSource.html")
         self.marionette.navigate(test_html)
         source = self.marionette.page_source
         self.assertTrue("<html" in source)
         self.assertTrue("PageSource" in source)
 
+    def testShouldReturnTheSourceOfAPageWhenThereAreUnicodeChars(self):
+        test_html = self.marionette.absolute_url("testPageSourceWithUnicodeChars.html")
+        self.marionette.navigate(test_html)
+        # if we don't throw on the next line we are good!
+        self.marionette.page_source
+
     def testShouldReturnAXMLDocumentSource(self):
         test_xml = self.marionette.absolute_url("testPageSource.xml")
         self.marionette.navigate(test_xml)
         source = self.marionette.page_source
         import re
         self.assertEqual(re.sub("\s", "", source), "<xml><foo><bar>baz</bar></foo></xml>")
 
+
 class TestPageSourceChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
         self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
         self.marionette.switch_to_window('foo')
         self.assertNotEqual(self.win, self.marionette.current_window_handle)
--- a/testing/marionette/client/marionette/tests/unit/unit-tests.ini
+++ b/testing/marionette/client/marionette/tests/unit/unit-tests.ini
@@ -82,16 +82,17 @@ browser = false
 [test_simpletest_chrome.js]
 [test_simpletest_timeout.js]
 [test_specialpowers.py]
 [test_switch_frame.py]
 [test_switch_frame_chrome.py]
 [test_switch_remote_frame.py]
 
 [test_pagesource.py]
+b2g = false
 
 [test_visibility.py]
 [test_window_switching.py]
 b2g = false
 [test_window_management.py]
 b2g = false
 
 [test_appcache.py]
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/www/testPageSourceWithUnicodeChars.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8"/>
+    <meta http-equiv="pragma" content="no-cache"/>
+    <!--
+      - the « section[id^="wifi-"] » selector.
+      -->
+  </body>
+</html>
+