Add a check for search ID

RESOLVED FIXED

Status

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jgriffin, Assigned: dminor)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
We've had a request to add a new test to the cert suite, one that verified the search ID.  The search ID is important because it allows us to generate income from searches performed by B2G.

To test this, we'll need to launch the browser app and then get the return value of this method:

https://github.com/mozilla-b2g/gaia/blob/e3028741ea872fdd199b8866ceef08b8564070d0/apps/browser/js/browser.js#L839

The value should contain this string:

client=mobile-firefoxos&channel=fm:org.mozilla:<OEMID>:official&

..and we should present <OEMID> to the user for verification.  <OEMID> will be in the format described by:

https://mana.mozilla.org/wiki/pages/viewpage.action?pageId=35066199
(Assignee)

Updated

4 years ago
Assignee: nobody → dminor
Status: NEW → ASSIGNED
(Assignee)

Comment 1

4 years ago
If I call getUrlFromInput('hello world') on my Flame running a 2.0 User build I get:

    https://www.google.com/search?q=hello world

Is that the expected behaviour for this phone/build?
Flags: needinfo?(jgriffin)
(Reporter)

Comment 2

4 years ago
(In reply to Dan Minor [:dminor] from comment #1)
> If I call getUrlFromInput('hello world') on my Flame running a 2.0 User
> build I get:
> 
>     https://www.google.com/search?q=hello world
> 
> Is that the expected behaviour for this phone/build?

Good question, let's ask Wayne.
Flags: needinfo?(jgriffin) → needinfo?(wchang)
It seems expected as is. We request launching partners to concatenate with this code:

getUrlFromInput: function browser_getUrlFromInput(input) {
    var hasScheme = !!(rscheme.exec(input) || [])[0];
     var googleSearchID = "client=mobile-firefoxos&channel=fm:org.mozilla:<OEMID>:official&";
 
    // Not a valid URL, could be a search term
    if (UrlHelper.isNotURL(input) && this.searchEngine.uri) {
      var uri = this.searchEngine.uri.replace('{searchTerms}', input);
        uri = uri.substring(0, 29) + googleSearchID + uri.substring(29); 
      return uri;
    }

Which is likely not present on the flame you tested. 
If the code had been added correctly then the URL string should contain <client=mobile-firefoxos&channel=fm:org.mozilla:<OEMID>:official&>
Flags: needinfo?(wchang)
(Assignee)

Comment 4

4 years ago
(In reply to Wayne Chang [:wchang] from comment #3)
> It seems expected as is. We request launching partners to concatenate with
> this code:
> 
> getUrlFromInput: function browser_getUrlFromInput(input) {
>     var hasScheme = !!(rscheme.exec(input) || [])[0];
>      var googleSearchID =
> "client=mobile-firefoxos&channel=fm:org.mozilla:<OEMID>:official&";
>  
>     // Not a valid URL, could be a search term
>     if (UrlHelper.isNotURL(input) && this.searchEngine.uri) {
>       var uri = this.searchEngine.uri.replace('{searchTerms}', input);
>         uri = uri.substring(0, 29) + googleSearchID + uri.substring(29); 
>       return uri;
>     }
> 
> Which is likely not present on the flame you tested. 
> If the code had been added correctly then the URL string should contain
> <client=mobile-firefoxos&channel=fm:org.mozilla:<OEMID>:official&>

Thanks! I wanted to make sure I wasn't missing anything - I'll write the test against the exepcted results.
(Assignee)

Updated

4 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.