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:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121754
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-03 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ 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.
+
+ * 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:
+
2012-07-03 Vsevolod Vlasov <vsevik@chromium.org>
Web Inspector: Save scroll selection and cursor position of SourceFrames in sources panel.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS connection.bandwidth is bandwidth
-PASS connection.metered is metered
-PASS connection.bandwidth is bandwidth
-PASS connection.metered is metered
-PASS connection.bandwidth is bandwidth
-PASS connection.metered is metered
+PASS typeof connection.bandwidth is "number"
+PASS typeof connection.metered is "boolean"
+PASS typeof connection.bandwidth is "number"
+PASS typeof connection.metered is "boolean"
+PASS typeof connection.bandwidth is "number"
+PASS typeof connection.metered is "boolean"
PASS successfullyParsed is true
TEST COMPLETE
webkitnetworkinfochange event is raised
-PASS connection.bandwidth is bandwidth
-PASS connection.metered is metered
+PASS typeof connection.bandwidth is "number"
+PASS typeof connection.metered is "boolean"
PASS successfullyParsed is true
TEST COMPLETE
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS connection.bandwidth is bandwidth
-PASS connection.metered is metered
+PASS typeof connection.bandwidth is "number"
+PASS typeof connection.metered is "boolean"
PASS successfullyParsed is true
TEST COMPLETE
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS connection.bandwidth is bandwidth
-PASS connection.metered is metered
-PASS connection.bandwidth is bandwidth
-PASS connection.metered is metered
+PASS typeof connection.bandwidth is "number"
+PASS typeof connection.metered is "boolean"
+PASS typeof connection.bandwidth is "number"
+PASS typeof connection.metered is "boolean"
PASS successfullyParsed is true
TEST COMPLETE
var connection = navigator.webkitConnection;
function checkNetworkInformation() {
- shouldBe('connection.bandwidth', 'bandwidth');
- shouldBe('connection.metered', 'metered');
+ shouldBe("typeof connection.bandwidth", '"number"');
+ shouldBe("typeof connection.metered", '"boolean"');
}
var firstListenerEvents = 0;
var connection = navigator.webkitConnection;
function checkNetworkInformation() {
- shouldBe('connection.bandwidth', 'bandwidth');
- shouldBe('connection.metered', 'metered');
+ shouldBe("typeof connection.bandwidth", '"number"');
+ shouldBe("typeof connection.metered", '"boolean"');
}
connection.addEventListener('webkitnetworkinfochange', function() {
var connection = navigator.webkitConnection;
connection.addEventListener('webkitnetworkinfochange', function() {
- shouldBe('connection.bandwidth', 'bandwidth');
- shouldBe('connection.metered', 'metered');
+ shouldBe("typeof connection.bandwidth", '"number"');
+ shouldBe("typeof connection.metered", '"boolean"');
finishJSTest();
});
var connection = navigator.webkitConnection;
function checkNetworkInformation() {
- shouldBe('connection.bandwidth', 'bandwidth');
- shouldBe('connection.metered', 'metered');
+ shouldBe("typeof connection.bandwidth", '"number"');
+ shouldBe("typeof connection.metered", '"boolean"');
}
function checkChildNetworkInformation() {
- shouldBe('connection.bandwidth', 'bandwidth');
- shouldBe('connection.metered', 'metered');
+ shouldBe("typeof connection.bandwidth", '"number"');
+ shouldBe("typeof connection.metered", '"boolean"');
}
var hasMainFrameEventFired = false;
var connection = navigator.webkitConnection;
function checkNetworkInformation() {
- shouldBe('connection.bandwidth', 'bandwidth');
- shouldBe('connection.metered', 'metered');
+ shouldBe("typeof connection.bandwidth", '"number"');
+ shouldBe("typeof connection.metered", '"boolean"');
}
function setNetworkInformation() {
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS connection.bandwidth is bandwidth
-PASS connection.metered is metered
-PASS connection.bandwidth is bandwidth
-PASS connection.metered is metered
+PASS typeof connection.bandwidth is "number"
+PASS typeof connection.metered is "boolean"
+PASS typeof connection.bandwidth is "number"
+PASS typeof connection.metered is "boolean"
PASS successfullyParsed is true
TEST COMPLETE
+2012-07-03 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ 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.
+
+ No new tests. Covered by existing tests.
+
+ * Modules/networkinfo/NetworkInfoConnection.cpp:
+ (WebCore::NetworkInfoConnection::bandwidth):
+ (WebCore::NetworkInfoConnection::metered):
+
2012-07-03 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
[EFL] [WK2] Don't call eina_iterator_free() if iterator is NULL
double NetworkInfoConnection::bandwidth() const
{
- if (m_networkInfo)
- return m_networkInfo->bandwidth();
-
return m_controller->client()->bandwidth();
}
bool NetworkInfoConnection::metered() const
{
- if (m_networkInfo)
- return m_networkInfo->metered();
-
return m_controller->client()->metered();
}