Closed Bug 1107545 Opened 10 years ago Closed 10 years ago

[EME] Test case for off-main-thread GMPStorage APIs

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(2 files, 3 obsolete files)

Bug 1102607 makes GMPStorage APIs callable from all threads. Per bug 1102607 comment 14, we should have test cases for exercising the APIs in non-main threads.
Introduce a test manager to make storage tests scalable and easier to add more tests.
Assignee: nobody → jwwang
Status: NEW → ASSIGNED
Attachment #8532090 - Flags: review?(cpearce)
Add off-main-thread tests for GMPStorage APIs.
Attachment #8532092 - Flags: review?(cpearce)
Depends on: 1102607
Attachment #8532090 - Flags: review?(cpearce) → review+
Comment on attachment 8532092 [details] [diff] [review]
1107545_part2_add_off_main_thread_tests-v1.patch

Review of attachment 8532092 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with nits fixed.

::: dom/media/gmp-plugin/gmp-test-decryptor.cpp
@@ +363,5 @@
> +  // Off-main-thread tests.
> +  if (g_platform_api->createthread(&thread) == GMPNoErr) {
> +    thread->Post(new TestStorageTask("thread1-", testManager));
> +    thread->Join();
> +  }

I think we should fail the test of the createthread function fails.

@@ +367,5 @@
> +  }
> +
> +  if (g_platform_api->createthread(&thread) == GMPNoErr) {
> +    thread->Post(new TestStorageTask("thread2-", testManager));
> +    thread->Join();

I think we should run both these cases concurrently. So we should have thread1 and thread2 variables, and post the tasks to both, and then join the threads after the tasks have been posted.
Attachment #8532092 - Flags: review?(cpearce) → review+
Comment on attachment 8532092 [details] [diff] [review]
1107545_part2_add_off_main_thread_tests-v1.patch

Review of attachment 8532092 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/media/gmp-plugin/gmp-test-decryptor.cpp
@@ +363,5 @@
> +  // Off-main-thread tests.
> +  if (g_platform_api->createthread(&thread) == GMPNoErr) {
> +    thread->Post(new TestStorageTask("thread1-", testManager));
> +    thread->Join();
> +  }

By calling FakeDecryptor::Message("FAIL xxx") here?

@@ +367,5 @@
> +  }
> +
> +  if (g_platform_api->createthread(&thread) == GMPNoErr) {
> +    thread->Post(new TestStorageTask("thread2-", testManager));
> +    thread->Join();

Will do.
(In reply to JW Wang [:jwwang] from comment #4)
> Comment on attachment 8532092 [details] [diff] [review]
> 1107545_part2_add_off_main_thread_tests-v1.patch
> 
> Review of attachment 8532092 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/media/gmp-plugin/gmp-test-decryptor.cpp
> @@ +363,5 @@
> > +  // Off-main-thread tests.
> > +  if (g_platform_api->createthread(&thread) == GMPNoErr) {
> > +    thread->Post(new TestStorageTask("thread1-", testManager));
> > +    thread->Join();
> > +  }
> 
> By calling FakeDecryptor::Message("FAIL xxx") here?

Yes.
Address nits in comment 3.
Attachment #8532092 - Attachment is obsolete: true
Attachment #8532145 - Flags: review+
rebase.
Attachment #8532090 - Attachment is obsolete: true
Attachment #8532379 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/1185ff1ada05
https://hg.mozilla.org/mozilla-central/rev/769d12f35376
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: