Bug 811747: Adding a test for checking that page_source handles unicode chars; r=jgriffin
☠☠ backed out by 685e1c1a71eb ☠ ☠
authorDavid Burns <dburns@mozilla.com>
Wed, 09 Jan 2013 14:32:54 +0000
changeset 198646 a3e1f186d06ab4fe67206a879a67b58209b16142
parent 198645 6bb03867a3adb440473efb256d7fd91a54a1dbec
child 198647 685e1c1a71ebfa4d381133d925d06851bd56085b
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [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,17 +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]
 browser = false
 [test_pagesource.py]
-
+b2g = false
 [test_visibility.py]
 [test_window_switching.py]
 b2g = false
 [test_window_management.py]
 b2g = false
 
 [test_appcache.py]
 [test_screenshot.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>
+