summaryrefslogtreecommitdiffstats
path: root/dom/tethering/tests/marionette/test_wifi_tethering_dun.js
blob: 3d93cf8d345b56edfb8a89dc3f9c61d82429812c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* 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/. */

MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = 'head.js';

gTestSuite.startTest(function() {
  let origApnSettings;
  return gTestSuite.getDataApnSettings()
    .then(value => {
      origApnSettings = value;
    })
    .then(() => {
      // Set dun apn settings.
      let apnSettings = [[ { "carrier": "T-Mobile US",
                             "apn": "epc1.tmobile.com",
                             "mmsc": "http://mms.msg.eng.t-mobile.com/mms/wapenc",
                             "types": ["default","supl","mms"] },
                           { "carrier": "T-Mobile US",
                             "apn": "epc2.tmobile.com",
                             "types": ["dun"] } ]];
      return gTestSuite.setDataApnSettings(apnSettings);
    })
    .then(() => gTestSuite.setTetheringDunRequired())
    .then(() => gTestSuite.startTetheringTest(function() {
      return gTestSuite.ensureWifiEnabled(false)
        .then(() => gTestSuite.setWifiTetheringEnabled(true, true))
        .then(() => gTestSuite.setWifiTetheringEnabled(false, true));
    }))
    // Restore apn settings.
    .then(() => {
      if (origApnSettings) {
        return gTestSuite.setDataApnSettings(origApnSettings);
      }
    });
});