Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Unified Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeys-with-session.html

Issue 2606633002: encrypted-media tests should not count # of SuspendableObjects (Closed)
Patch Set: temp Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeysession-reference.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeys-with-session.html
diff --git a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeys-with-session.html b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeys-with-session.html
index 6def08fd224658fc3c34dffd1f654866a61dba18..25a7cc9331485381e3fd7cc6c52f0cb28f1e1455 100644
--- a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeys-with-session.html
+++ b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeys-with-session.html
@@ -19,14 +19,21 @@
// For this test, create a MediaKeySession and verify lifetime.
async_test(function(test)
{
+ gc();
var initDataType;
var initData;
var mediaKeys;
- var startingSuspendableObjectCount = window.internals.suspendableObjectCount(document);
+ var startingMediaKeysCount = window.internals.mediaKeysCount();
+ var startingMediaKeySessionCount = window.internals.mediaKeySessionCount();
- function numSuspendableObjectsCreated()
+ function numMediaKeysCreated()
{
- return window.internals.suspendableObjectCount(document) - startingSuspendableObjectCount;
+ return window.internals.mediaKeysCount() - startingMediaKeysCount;
+ }
+
+ function numMediaKeySessionCreated()
+ {
+ return window.internals.mediaKeySessionCount() - startingMediaKeySessionCount;
}
// Create a MediaKeys object with a session.
@@ -37,27 +44,14 @@
}).then(function(result) {
mediaKeys = result;
- // Verify MediaKeys is an SuspendableObject.
- // In non-Oilpan, numSuspendableObjectsCreate() == 1.
- // In Oilpan, numSuspendableObjectsCreate() <= 4.
- // (1 MediaKeys,
- // 1 MediaKeysInitializer and
- // 1 MediaKeySystemAccessInitializer (navigator.requestMediaKeySystemAccess() use above),
- // 1 MediaKeySystemAccessInitializer (isInitDataSupported() (via getSupportedInitDataType())))
- assert_between_inclusive(numSuspendableObjectsCreated(), 1, 4, 'MediaKeys.create()');
+ assert_equals(numMediaKeysCreated(), 1, 'MediaKeys.create()');
+ assert_equals(numMediaKeySessionCreated(), 0, 'After final gc()');
var mediaKeySession = mediaKeys.createSession();
return mediaKeySession.generateRequest(initDataType, initData);
}).then(function() {
- // Should be 1 MediaKeys + 1 MediaKeySession.
- // In non-Oilpan, numSuspendableObjectsCreate() == 2.
- // In Oilpan, numSuspendableObjectsCreate() <= 6.
- // (1 MediaKeys,
- // 1 MediaKeysInitializer and
- // 2 MediaKeySystemAccessInitializer,
- // 1 ContentDecryptionModuleResultPromise and
- // 1 MediaKeySession).
- assert_between_inclusive(numSuspendableObjectsCreated(), 2, 6, 'MediaKeys.createSession()');
+ assert_equals(numMediaKeysCreated(), 1, 'MediaKeys.createSession()');
+ assert_equals(numMediaKeySessionCreated(), 1, 'MediaKeys.createSession()');
// Run gc(), should not affect MediaKeys object nor the
// session since we still have a reference to it.
@@ -68,9 +62,8 @@
}).then(function(result) {
assert_equals(typeof mediaKeys.createSession, 'function');
- // MediaKeys + MediaKeySessions should remain.
- // In non-Oilpan, there is also something from createGCPromise().
- assert_between_inclusive(numSuspendableObjectsCreated(), 2, 3, 'After gc()');
+ assert_equals(numMediaKeysCreated(), 1, 'After gc()');
+ assert_equals(numMediaKeySessionCreated(), 1, 'After gc()');
// Drop reference to the MediaKeys object and run gc()
// again. Object should be collected this time. Since
@@ -85,9 +78,8 @@
}).then(function(result) {
return createGCPromise();
}).then(function(result) {
- // No MediaKeySessions should remain.
- // In non-Oilpan, there is also something from createGCPromise().
- assert_between_inclusive(numSuspendableObjectsCreated(), 0, 1, 'After final gc()');
+ assert_equals(numMediaKeysCreated(), 0, 'After final gc()');
+ assert_equals(numMediaKeySessionCreated(), 0, 'After final gc()');
test.done();
}).catch(function(error) {
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeysession-reference.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698