Brave Browser Bug Fix

In this lab, our task was to fix a bug in the Brave Browser.  The bug was when a URL containing white-spaces in specific places were passed through the URL Bar the result would be much different than what the other browsers would produce.

The first step in fixing the bug was to re-create the bug.  This was very simple as we just passed through a URL which contained spaced and behold the bug appeared. I also tried inputting the same URL's in other browsers such as Chrome and Firefox and this issue did not occur. So the tests that worked and the ones that didn't work in Brave are as follows.

"dog" --> worked
" dog " --> worked
"dog cat" --> worked
" dog cat " --> worked
"https://www.google.ca/search?q=dog" --> worked
" https://www.google.ca/search?q=dog " --> worked
"https://www.google.ca/search?q=dog cat" -> Didn't work, it searches the link instead
" https://www.google.ca/search?q=dog cat " -> Didn't work, it searches the link instead

"/home/pranoy/Desktop/dog cat.txt" --> Didn't work, searches for the whole string
" /home/pranoy/Desktop/dog cat.txt " --> Didn't work, searches for the whole string
"file:///home/pranoy/Desktop/dog cat.txt" --> worked
" file:///home/pranoy/Desktop/dog cat.txt " --> worked

The fix for this was fairly simple.  It was just changing one line of code


This line just replaces an empty white-space with "%20".  This seemed like the only issue to fix and after this I ran Brave in debug mode and tested out the results with the strings mentioned above that didn't work. This proved to be a success. Below are the screenshots that show that the code fix was successful.


After this we added some test cases for the cases that weren't working before and now they are.  The test also pass.

Comments

Popular posts from this blog

Assignment 1 - DPS909

ECMA Script Testing

Release 0.2 - Bug fix