summaryrefslogtreecommitdiff
path: root/indra/newview/tests
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2009-11-10 17:24:02 -0800
committerRick Pasetto <rick@lindenlab.com>2009-11-10 17:24:02 -0800
commit353ac3969efc5bda81b34f4edb3756dd6ced0412 (patch)
tree467c97cef1f760672503096c2fed3f27618bdc68 /indra/newview/tests
parent2420a4b90c964bcc2c928c4593652fdf81e0e20f (diff)
FIX DEV-41991: do not allow media settings panel to come up if media data is in flight
Review #33 This change marks the current selection "not editable" if any objects in the selection are currently "in flight" (i.e. their media data has not been fetched yet, or is in the process of being fetched). This involved adding API to LLMediaDataClient to query whether an object is in the process of being fetched (i.e. in the queue). I've added a unit test for this new API.
Diffstat (limited to 'indra/newview/tests')
-rw-r--r--indra/newview/tests/llmediadataclient_test.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp
index 445ec7aa34..3ac631d96e 100644
--- a/indra/newview/tests/llmediadataclient_test.cpp
+++ b/indra/newview/tests/llmediadataclient_test.cpp
@@ -497,5 +497,38 @@ namespace tut
ensure("REF COUNT", o->getNumRefs(), 1);
}
-
+ template<> template<>
+ void mediadataclient_object_t::test<7>()
+ {
+ // Test LLMediaDataClient::isInQueue()
+ LOG_TEST(7);
+
+ LLMediaDataClientObject::ptr_t o1 = new LLMediaDataClientObjectTest(
+ _DATA(VALID_OBJECT_ID_1,"3.0","1.0"));
+ LLMediaDataClientObject::ptr_t o2 = new LLMediaDataClientObjectTest(
+ _DATA(VALID_OBJECT_ID_2,"1.0","1.0"));
+ int num_refs_start = o1->getNumRefs();
+ {
+ LLPointer<LLObjectMediaDataClient> mdc = new LLObjectMediaDataClient(NO_PERIOD,NO_PERIOD);
+
+ ensure("not in queue yet 1", ! mdc->isInQueue(o1));
+ ensure("not in queue yet 2", ! mdc->isInQueue(o2));
+
+ mdc->fetchMedia(o1);
+
+ ensure("is in queue", mdc->isInQueue(o1));
+ ensure("is not in queue", ! mdc->isInQueue(o2));
+
+ ::pump_timers();
+
+ ensure("not in queue anymore", ! mdc->isInQueue(o1));
+ ensure("still is not in queue", ! mdc->isInQueue(o2));
+
+ ensure("queue empty", mdc->isEmpty());
+ }
+
+ // Make sure everyone's destroyed properly
+ ensure("REF COUNT", o1->getNumRefs(), num_refs_start);
+
+ }
}