Changeset 121754 in webkit


Ignore:
Timestamp:
Jul 3, 2012 3:12:47 AM (12 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

Improve test cases for network information APIs
https://bugs.webkit.org/show_bug.cgi?id=90162

Reviewed by Adam Barth.

Existing implementation doesn't test port implementation in network info APIs.
This patch lets test cases use bandwidth and metered functions implemented by port layer.

In addition, expected results need to check return type instead of property name.

Source/WebCore:

No new tests. Covered by existing tests.

  • Modules/networkinfo/NetworkInfoConnection.cpp:

(WebCore::NetworkInfoConnection::bandwidth):
(WebCore::NetworkInfoConnection::metered):

LayoutTests:

  • networkinformation/add-listener-from-callback-expected.txt:
  • networkinformation/basic-all-types-of-events-expected.txt:
  • networkinformation/basic-operation-expected.txt:
  • networkinformation/multiple-frames-expected.txt:
  • networkinformation/script-tests/add-listener-from-callback.js:

(checkNetworkInformation):

  • networkinformation/script-tests/basic-all-types-of-events.js:

(checkNetworkInformation):

  • networkinformation/script-tests/basic-operation.js:
  • networkinformation/script-tests/multiple-frames.js:

(checkNetworkInformation):
(checkChildNetworkInformation):

  • networkinformation/script-tests/updates.js:

(checkNetworkInformation):

  • networkinformation/updates-expected.txt:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r121750 r121754  
     12012-07-03  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Improve test cases for network information APIs
     4        https://bugs.webkit.org/show_bug.cgi?id=90162
     5
     6        Reviewed by Adam Barth.
     7
     8        Existing implementation doesn't test port implementation in network info APIs.
     9        This patch lets test cases use bandwidth and metered functions implemented by port layer.
     10
     11        In addition, expected results need to check return type instead of property name.
     12
     13        * networkinformation/add-listener-from-callback-expected.txt:
     14        * networkinformation/basic-all-types-of-events-expected.txt:
     15        * networkinformation/basic-operation-expected.txt:
     16        * networkinformation/multiple-frames-expected.txt:
     17        * networkinformation/script-tests/add-listener-from-callback.js:
     18        (checkNetworkInformation):
     19        * networkinformation/script-tests/basic-all-types-of-events.js:
     20        (checkNetworkInformation):
     21        * networkinformation/script-tests/basic-operation.js:
     22        * networkinformation/script-tests/multiple-frames.js:
     23        (checkNetworkInformation):
     24        (checkChildNetworkInformation):
     25        * networkinformation/script-tests/updates.js:
     26        (checkNetworkInformation):
     27        * networkinformation/updates-expected.txt:
     28
    1292012-07-03  Vsevolod Vlasov  <vsevik@chromium.org>
    230
  • trunk/LayoutTests/networkinformation/add-listener-from-callback-expected.txt

    r112815 r121754  
    44
    55
    6 PASS connection.bandwidth is bandwidth
    7 PASS connection.metered is metered
    8 PASS connection.bandwidth is bandwidth
    9 PASS connection.metered is metered
    10 PASS connection.bandwidth is bandwidth
    11 PASS connection.metered is metered
     6PASS typeof connection.bandwidth is "number"
     7PASS typeof connection.metered is "boolean"
     8PASS typeof connection.bandwidth is "number"
     9PASS typeof connection.metered is "boolean"
     10PASS typeof connection.bandwidth is "number"
     11PASS typeof connection.metered is "boolean"
    1212PASS successfullyParsed is true
    1313
  • trunk/LayoutTests/networkinformation/basic-all-types-of-events-expected.txt

    r112815 r121754  
    55
    66webkitnetworkinfochange event is raised
    7 PASS connection.bandwidth is bandwidth
    8 PASS connection.metered is metered
     7PASS typeof connection.bandwidth is "number"
     8PASS typeof connection.metered is "boolean"
    99PASS successfullyParsed is true
    1010
  • trunk/LayoutTests/networkinformation/basic-operation-expected.txt

    r112815 r121754  
    44
    55
    6 PASS connection.bandwidth is bandwidth
    7 PASS connection.metered is metered
     6PASS typeof connection.bandwidth is "number"
     7PASS typeof connection.metered is "boolean"
    88PASS successfullyParsed is true
    99
  • trunk/LayoutTests/networkinformation/multiple-frames-expected.txt

    r112815 r121754  
    44
    55
    6 PASS connection.bandwidth is bandwidth
    7 PASS connection.metered is metered
    8 PASS connection.bandwidth is bandwidth
    9 PASS connection.metered is metered
     6PASS typeof connection.bandwidth is "number"
     7PASS typeof connection.metered is "boolean"
     8PASS typeof connection.bandwidth is "number"
     9PASS typeof connection.metered is "boolean"
    1010PASS successfullyParsed is true
    1111
  • trunk/LayoutTests/networkinformation/script-tests/add-listener-from-callback.js

    r112815 r121754  
    77
    88function checkNetworkInformation() {
    9     shouldBe('connection.bandwidth', 'bandwidth');
    10     shouldBe('connection.metered', 'metered');
     9    shouldBe("typeof connection.bandwidth", '"number"');
     10    shouldBe("typeof connection.metered", '"boolean"');
    1111}
    1212
  • trunk/LayoutTests/networkinformation/script-tests/basic-all-types-of-events.js

    r112815 r121754  
    77
    88function checkNetworkInformation() {
    9     shouldBe('connection.bandwidth', 'bandwidth');
    10     shouldBe('connection.metered', 'metered');
     9    shouldBe("typeof connection.bandwidth", '"number"');
     10    shouldBe("typeof connection.metered", '"boolean"');
    1111}
    1212
  • trunk/LayoutTests/networkinformation/script-tests/basic-operation.js

    r112815 r121754  
    77
    88connection.addEventListener('webkitnetworkinfochange', function() {
    9     shouldBe('connection.bandwidth', 'bandwidth');
    10     shouldBe('connection.metered', 'metered');
     9    shouldBe("typeof connection.bandwidth", '"number"');
     10    shouldBe("typeof connection.metered", '"boolean"');
    1111    finishJSTest();
    1212});
  • trunk/LayoutTests/networkinformation/script-tests/multiple-frames.js

    r112815 r121754  
    77
    88function checkNetworkInformation() {
    9     shouldBe('connection.bandwidth', 'bandwidth');
    10     shouldBe('connection.metered', 'metered');
     9    shouldBe("typeof connection.bandwidth", '"number"');
     10    shouldBe("typeof connection.metered", '"boolean"');
    1111}
    1212
    1313function checkChildNetworkInformation() {
    14     shouldBe('connection.bandwidth', 'bandwidth');
    15     shouldBe('connection.metered', 'metered');
     14    shouldBe("typeof connection.bandwidth", '"number"');
     15    shouldBe("typeof connection.metered", '"boolean"');
    1616}
    1717
  • trunk/LayoutTests/networkinformation/script-tests/updates.js

    r112815 r121754  
    77
    88function checkNetworkInformation() {
    9     shouldBe('connection.bandwidth', 'bandwidth');
    10     shouldBe('connection.metered', 'metered');
     9    shouldBe("typeof connection.bandwidth", '"number"');
     10    shouldBe("typeof connection.metered", '"boolean"');
    1111}
    1212
  • trunk/LayoutTests/networkinformation/updates-expected.txt

    r112815 r121754  
    44
    55
    6 PASS connection.bandwidth is bandwidth
    7 PASS connection.metered is metered
    8 PASS connection.bandwidth is bandwidth
    9 PASS connection.metered is metered
     6PASS typeof connection.bandwidth is "number"
     7PASS typeof connection.metered is "boolean"
     8PASS typeof connection.bandwidth is "number"
     9PASS typeof connection.metered is "boolean"
    1010PASS successfullyParsed is true
    1111
  • trunk/Source/WebCore/ChangeLog

    r121752 r121754  
     12012-07-03  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Improve test cases for network information APIs
     4        https://bugs.webkit.org/show_bug.cgi?id=90162
     5
     6        Reviewed by Adam Barth.
     7
     8        Existing implementation doesn't test port implementation in network info APIs.
     9        This patch lets test cases use bandwidth and metered functions implemented by port layer.
     10
     11        In addition, expected results need to check return type instead of property name.
     12
     13        No new tests. Covered by existing tests.
     14
     15        * Modules/networkinfo/NetworkInfoConnection.cpp:
     16        (WebCore::NetworkInfoConnection::bandwidth):
     17        (WebCore::NetworkInfoConnection::metered):
     18
    1192012-07-03  Sudarsana Nagineni  <sudarsana.nagineni@linux.intel.com>
    220
  • trunk/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.cpp

    r121312 r121754  
    5858double NetworkInfoConnection::bandwidth() const
    5959{
    60     if (m_networkInfo)
    61         return m_networkInfo->bandwidth();
    62    
    6360    return m_controller->client()->bandwidth();
    6461}
     
    6663bool NetworkInfoConnection::metered() const
    6764{
    68     if (m_networkInfo)
    69         return m_networkInfo->metered();
    70    
    7165    return m_controller->client()->metered();
    7266}
Note: See TracChangeset for help on using the changeset viewer.