~chromium-team/chromium-browser/trusty-beta

« back to all changes in this revision

Viewing changes to debian/tests/data/HTML5test/backend/models/lab.php

  • Committer: Olivier Tilloy
  • Date: 2017-10-23 16:46:53 UTC
  • mfrom: (1172.1.38 trusty-stable)
  • Revision ID: olivier.tilloy@canonical.com-20171023164653-zmpfzblxxnkj0jhj
Merge back changes from stable branch:
  * debian/control: bump Standards-Version to 4.1.1
  * debian/patches/set-rpath-on-chromium-executables.patch: updated
  * debian/tests/*:
    - removed stale autopkgtests
    - added new autopkgtests based on chromium's new headless mode
  * debian/source/include-binaries: updated to reflect new binary data in tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
        class Lab {
 
4
 
 
5
                function getDevice($id) {
 
6
                        $db = Factory::Database();
 
7
 
 
8
                        $res = $db->query("
 
9
                                SELECT
 
10
                                        *
 
11
                                FROM
 
12
                                        labDevices
 
13
                                WHERE
 
14
                                        id = '" . intval($id) . "'
 
15
                        ");
 
16
 
 
17
                        if ($row = $res->fetch_object()) {
 
18
                                $row->simSize = ucfirst($row->simSize);
 
19
                                $row->simLocked = !! $row->simLocked;
 
20
                                $row->hasInspect = !! $row->hasInspect;
 
21
                                $row->hasWifi = !! $row->hasWifi;
 
22
                                $row->otherBrowsers = explode(',', $row->otherBrowsers);
 
23
                                $row->otherBrowsers = array_combine($row->otherBrowsers, $row->otherBrowsers);
 
24
 
 
25
                                switch($row->deviceType) {
 
26
                                        case 'mobile':          $row->type = 'Phone'; break;
 
27
                                        case 'tablet':          $row->type = 'Tablet'; break;
 
28
                                        case 'media':           $row->type = 'Media player'; break;
 
29
                                        case 'netbook':         $row->type = 'Netbook'; break;
 
30
                                        case 'laptop':          $row->type = 'Laptop'; break;
 
31
                                        case 'ereader':         $row->type = 'E-reader'; break;
 
32
                                        case 'gaming':          $row->type = 'Gaming'; break;
 
33
                                        case 'pda':             $row->type = 'PDA'; break;
 
34
                                        case 'television':      $row->type = 'Television'; break;
 
35
                                        default:                        $row->type = 'Other';
 
36
                                }
 
37
 
 
38
                                if ($row->defaultFingerprint) {
 
39
                                        $row->defaultResults = Results::getByUniqueId($row->defaultFingerprint);
 
40
                                }
 
41
 
 
42
                                return $row;
 
43
                        }
 
44
                }
 
45
 
 
46
        }
 
 
b'\\ No newline at end of file'