Open
Bug 857476
Opened 12 years ago
Updated 2 years ago
getTextAtOffset returns wrong result at offset after multiline object
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
NEW
People
(Reporter: surkov, Unassigned, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: access, good-first-bug, Whiteboard: [lang=js])
we were reported that getTextAtOffset returns wrong results if the given offset is after an object spanned at mutiple lines for example
<p>this works well <a>mutli<br>lines</a> any offset starting from here doesn't work</p>
Reporter | ||
Updated•12 years ago
|
OS: Mac OS X → All
Reporter | ||
Comment 1•11 years ago
|
||
apparently the bug was fixed, I cannot longer reproduce it on Nightly (both word_start and line_start) so we need to have mochitest coverage (see text/test_wordboundary.html and test_lineboundary.html). Volunteers?
Whiteboard: [good first bug][mentor=surkov.alexander@gmail.com][lang=js]
Assignee | ||
Updated•10 years ago
|
Mentor: surkov.alexander
Whiteboard: [good first bug][mentor=surkov.alexander@gmail.com][lang=js] → [good first bug][lang=js]
I would like to work on this, but this is my first bug so I'd need some help. I have firefox built, but when I run:
./mach mochitest-browser accessible/tests/mochitest/text/test_wordoundary.html
I get:
From _tests: Kept 20658 existing; Added/updated 0; Removed 0 files and 0 directories.
No tests could be found in the path specified. Please specify a path that is a test file or is a directory containing tests.
For anyone interested in working on this bug, I found out that the command to run accessibility tests is:
./mach mochitest-a11y accessible/tests/mochitest/text/test_wordoundary.html
As documented here: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Automated_testing
Comment 5•8 years ago
|
||
Hello. I tried to run the tests on as specified by https://bugzilla.mozilla.org/show_bug.cgi?id=857476#c3
Attached is the full output of the errors I got. It threw an error regarding a read-only filesystem in /tmp. Regardless of whether I used sudo or the root user. Any suggestions on what to do next are welcomed.
Error as normal user:
user@localhost:~/mozilla-central$ ./mach mochitest-a11y accessible/tests/mochitest/text/test_wordboundary.html
mkdir: cannot create directory ‘/tmp/cg-5034’: Read-only file system
config.guess: cannot create a temporary directory in /tmp
Error running mach:
['mochitest-a11y', 'accessible/tests/mochitest/text/test_wordboundary.html']
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You should consider filing a bug for this issue.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
CalledProcessError: Command '[u'/home/user/mozilla-central/build/autoconf/config.guess']' returned non-zero exit status 1
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 716, in __init__
self._ensure_state_subdir_exists('.')
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 432, in _ensure_state_subdir_exists
path = os.path.join(self.statedir, subdir)
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 266, in statedir
return os.path.join(self.topobjdir, '.mozbuild')
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 192, in topobjdir
default='obj-@CONFIG_GUESS@')
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 181, in resolve_mozconfig_topobjdir
self.resolve_config_guess())
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 364, in resolve_config_guess
subprocess.check_output(args, cwd=self.topsrcdir).strip())
File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
raise CalledProcessError(retcode, cmd, output=output)
Error using sudo to grant permission to access the /tmp folder:
user@localhost:~/mozilla-central$ sudo ./mach mochitest-a11y accessible/tests/mochitest/text/test_wordboundary.html
sudo: unable to open /var/lib/sudo/ts/user: Read-only file system
[sudo] password for user:
mkdir: cannot create directory ‘/tmp/cg-5060’: Read-only file system
config.guess: cannot create a temporary directory in /tmp
Error running mach:
['mochitest-a11y', 'accessible/tests/mochitest/text/test_wordboundary.html']
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You should consider filing a bug for this issue.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
CalledProcessError: Command '[u'/home/user/mozilla-central/build/autoconf/config.guess']' returned non-zero exit status 1
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 716, in __init__
self._ensure_state_subdir_exists('.')
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 432, in _ensure_state_subdir_exists
path = os.path.join(self.statedir, subdir)
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 266, in statedir
return os.path.join(self.topobjdir, '.mozbuild')
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 192, in topobjdir
default='obj-@CONFIG_GUESS@')
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 181, in resolve_mozconfig_topobjdir
self.resolve_config_guess())
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 364, in resolve_config_guess
subprocess.check_output(args, cwd=self.topsrcdir).strip())
File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
raise CalledProcessError(retcode, cmd, output=output)
Error running as root:
root@localhost:/home/user/mozilla-central# ./mach mochitest-a11y accessible/tests/mochitest/text/test_wordboundary.html
mkdir: cannot create directory ‘/tmp/cg-5118’: Read-only file system
config.guess: cannot create a temporary directory in /tmp
Error running mach:
['mochitest-a11y', 'accessible/tests/mochitest/text/test_wordboundary.html']
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You should consider filing a bug for this issue.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
CalledProcessError: Command '[u'/home/user/mozilla-central/build/autoconf/config.guess']' returned non-zero exit status 1
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 716, in __init__
self._ensure_state_subdir_exists('.')
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 432, in _ensure_state_subdir_exists
path = os.path.join(self.statedir, subdir)
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 266, in statedir
return os.path.join(self.topobjdir, '.mozbuild')
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 192, in topobjdir
default='obj-@CONFIG_GUESS@')
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 181, in resolve_mozconfig_topobjdir
self.resolve_config_guess())
File "/home/user/mozilla-central/python/mozbuild/mozbuild/base.py", line 364, in resolve_config_guess
subprocess.check_output(args, cwd=self.topsrcdir).strip())
File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
raise CalledProcessError(retcode, cmd, output=output)
Flags: needinfo?(surkov.alexander)
Comment 6•8 years ago
|
||
The above errors were caused by a problem with my system.
Once /tmp was no longer a read-only filesystem, I re-ran the test. |./mach mochitest-a11y accessible/tests/mochitest/text/test_wordoundary.html| is an outdated way of running the test. The test is run as follows:
./mach mochitest accessible/tests/mochitest/text/test_wordboundary.html
Mochitest will then detect that you're running an accessibility test and will load mochitest-a11y.
Sample output:
6283 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAtOffset (word start): wrong start offset(got '0', expected: '0'), offset: 1, id: 'cntr_1' ;
6284 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAtOffset (word start): wrong end offset(got '2', expected: '2'), offset: 1, id: 'cntr_1' ;
6285 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAtOffset (word start): wrong text (got '', expected: ''), offset: 2, id: 'cntr_1' ;
6286 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAtOffset (word start): wrong start offset(got '2', expected: '2'), offset: 2, id: 'cntr_1' ;
6287 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAtOffset (word start): wrong end offset(got '3', expected: '3'), offset: 2, id: 'cntr_1' ;
6288 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAtOffset (word start): wrong text (got '', expected: ''), offset: 3, id: 'cntr_1' ;
6289 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAtOffset (word start): wrong start offset(got '2', expected: '2'), offset: 3, id: 'cntr_1' ;
6290 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAtOffset (word start): wrong end offset(got '3', expected: '3'), offset: 3, id: 'cntr_1' ;
6291 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong text (got '', expected: ''), offset: 0, id: 'cntr_1' ;
6292 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong start offset(got '2', expected: '2'), offset: 0, id: 'cntr_1' ;
6293 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong end offset(got '3', expected: '3'), offset: 0, id: 'cntr_1' ;
6294 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong text (got '', expected: ''), offset: 1, id: 'cntr_1' ;
6295 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong start offset(got '2', expected: '2'), offset: 1, id: 'cntr_1' ;
6296 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong end offset(got '3', expected: '3'), offset: 1, id: 'cntr_1' ;
6297 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong text (got '', expected: ''), offset: 2, id: 'cntr_1' ;
6298 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong start offset(got '3', expected: '3'), offset: 2, id: 'cntr_1' ;
6299 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong end offset(got '3', expected: '3'), offset: 2, id: 'cntr_1' ;
6300 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong text (got '', expected: ''), offset: 3, id: 'cntr_1' ;
6301 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong start offset(got '3', expected: '3'), offset: 3, id: 'cntr_1' ;
6302 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | getTextAfterOffset (word start): wrong end offset(got '3', expected: '3'), offset: 3, id: 'cntr_1' ;
GECKO(2234) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
GECKO(2234) | MEMORY STAT | vsize 1935MB | residentFast 292MB | heapAllocated 127MB
6303 INFO TEST-OK | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html | took 4247ms
6304 INFO TEST-START | Shutdown
6305 INFO Passed: 6250
6306 INFO Failed: 0
6307 INFO Todo: 50
6308 INFO Mode: non-e10s
6309 INFO Slowest: 4247ms - chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_wordboundary.html
6310 INFO SimpleTest FINISHED
6311 INFO TEST-INFO | Ran 1 Loops
6312 INFO SimpleTest FINISHED
GECKO(2234) | [2234] WARNING: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed: 'glib warning', file /home/herabus/mozilla-central/toolkit/xre/nsSigHandlers.cpp, line 142
GECKO(2234) | (firefox:2234): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed
TEST-INFO | Main app process: exit 0
runtests.py | Application ran for: 0:00:39.184065
zombiecheck | Reading PID log: /tmp/tmpBQFz0fpidlog
==> process 2234 launched child process 2257
zombiecheck | Checking for orphan process with PID: 2257
Stopping web server
Stopping web socket server
Stopping ssltunnel
leakcheck | refcount logging is off, so leaks can't be detected!
runtests.py | Running tests: end.
Buffered messages finished
SUITE-END | took 53s
Flags: needinfo?(surkov.alexander)
Comment 7•8 years ago
|
||
Running the test replacing test_wordboundary.html with test_lineboundary.html gives the following output.
./mach mochitest accessible/tests/mochitest/text/test_lineboundary.html
3723 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got 'hello', expected: 'hello'), offset: 6, id: 'li10' ;
3724 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '4', expected: '4'), offset: 6, id: 'li10' ;
3725 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '9', expected: '9'), offset: 6, id: 'li10' ;
3726 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got 'hello', expected: 'hello'), offset: 7, id: 'li10' ;
3727 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '4', expected: '4'), offset: 7, id: 'li10' ;
3728 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '9', expected: '9'), offset: 7, id: 'li10' ;
3729 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got 'hello', expected: 'hello'), offset: 8, id: 'li10' ;
3730 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '4', expected: '4'), offset: 8, id: 'li10' ;
3731 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '9', expected: '9'), offset: 8, id: 'li10' ;
3732 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got '', expected: ''), offset: 0, id: 'ol1' ;
3733 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '0', expected: '0'), offset: 0, id: 'ol1' ;
3734 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '1', expected: '1'), offset: 0, id: 'ol1' ;
3735 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got '', expected: ''), offset: 1, id: 'ol1' ;
3736 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '1', expected: '1'), offset: 1, id: 'ol1' ;
3737 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '2', expected: '2'), offset: 1, id: 'ol1' ;
3738 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got '', expected: ''), offset: 2, id: 'ol1' ;
3739 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '2', expected: '2'), offset: 2, id: 'ol1' ;
3740 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '3', expected: '3'), offset: 2, id: 'ol1' ;
3741 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got '', expected: ''), offset: 3, id: 'ol1' ;
3742 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '3', expected: '3'), offset: 3, id: 'ol1' ;
3743 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '4', expected: '4'), offset: 3, id: 'ol1' ;
3744 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got '', expected: ''), offset: 4, id: 'ol1' ;
3745 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '4', expected: '4'), offset: 4, id: 'ol1' ;
3746 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '5', expected: '5'), offset: 4, id: 'ol1' ;
3747 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got '', expected: ''), offset: 5, id: 'ol1' ;
3748 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '4', expected: '4'), offset: 5, id: 'ol1' ;
3749 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '5', expected: '5'), offset: 5, id: 'ol1' ;
3750 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong text (got '', expected: ''), offset: 0, id: 'ht_5' ;
3751 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong start offset(got '0', expected: '0'), offset: 0, id: 'ht_5' ;
3752 INFO TEST-PASS | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | getTextAtOffset (line start): wrong end offset(got '1', expected: '1'), offset: 0, id: 'ht_5' ;
GECKO(2583) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
GECKO(2583) | MEMORY STAT | vsize 1931MB | residentFast 316MB | heapAllocated 155MB
3753 INFO TEST-OK | chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html | took 3197ms
3754 INFO TEST-START | Shutdown
3755 INFO Passed: 3750
3756 INFO Failed: 0
3757 INFO Todo: 0
3758 INFO Mode: non-e10s
3759 INFO Slowest: 3197ms - chrome://mochitests/content/a11y/accessible/tests/mochitest/text/test_lineboundary.html
3760 INFO SimpleTest FINISHED
3761 INFO TEST-INFO | Ran 1 Loops
3762 INFO SimpleTest FINISHED
TEST-INFO | Main app process: exit 0
runtests.py | Application ran for: 0:00:12.109489
zombiecheck | Reading PID log: /tmp/tmpzHifYZpidlog
==> process 2583 launched child process 2605
zombiecheck | Checking for orphan process with PID: 2605
Stopping web server
Stopping web socket server
Stopping ssltunnel
leakcheck | refcount logging is off, so leaks can't be detected!
runtests.py | Running tests: end.
Buffered messages finished
SUITE-END | took 13s
Flags: needinfo?(surkov.alexander)
Reporter | ||
Comment 8•7 years ago
|
||
(In reply to Leni Kadali from comment #7)
> Running the test replacing test_wordboundary.html with
> test_lineboundary.html gives the following output.
>
> ./mach mochitest accessible/tests/mochitest/text/test_lineboundary.html
I afraid I'm not helpful on this error. There's something wrong with your system/build
> GECKO(2583) | MEMORY STAT vsizeMaxContiguous not supported in this build
> configuration.
> GECKO(2583) | MEMORY STAT | vsize 1931MB | residentFast 316MB |
> heapAllocated 155MB
these two likely point to your problem, did you try to ask #developers?
Flags: needinfo?(surkov.alexander)
Updated•5 years ago
|
Keywords: good-first-bug
Whiteboard: [good first bug][lang=js] → [lang=js]
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•