Bug 811747: Adding a test for checking that page_source handles unicode chars; r=jgriffin

This commit is contained in:
David Burns 2013-01-09 14:32:54 +00:00
parent 3ddb95e682
commit cbb200d9a8
3 changed files with 20 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# 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):
@ -12,6 +12,12 @@ class TestPageSource(MarionetteTestCase):
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)
@ -19,6 +25,7 @@ class TestPageSource(MarionetteTestCase):
import re
self.assertEqual(re.sub("\s", "", source), "<xml><foo><bar>baz</bar></foo></xml>")
class TestPageSourceChrome(MarionetteTestCase):
def setUp(self):
MarionetteTestCase.setUp(self)

View File

@ -87,7 +87,7 @@ browser = false
[test_switch_remote_frame.py]
browser = false
[test_pagesource.py]
b2g = false
[test_visibility.py]
[test_window_switching.py]
b2g = false

View File

@ -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>