175 TUid::Uid( KProfileUid ), KProfile, KNullDesC8 ); |
175 TUid::Uid( KProfileUid ), KProfile, KNullDesC8 ); |
176 |
176 |
177 THsPublisherInfo unknown( |
177 THsPublisherInfo unknown( |
178 TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); |
178 TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); |
179 |
179 |
180 // create 2 same without waiting first to finnish. Second should return |
180 // create 2 same without waiting first to finnish. |
181 // KErrAlreadyExists |
181 // Second won't be appended to load queue. |
182 TAiFwPublisherInfo info( data, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); |
182 TAiFwPublisherInfo info( data, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); |
183 iFactory->LoadPlugin( info ); |
183 iFactory->LoadPlugin( info ); |
184 iFactory->LoadPlugin( info ); |
184 iFactory->LoadPlugin( info ); |
185 iWait->Start(); |
185 iWait->Start(); |
186 EUNIT_ASSERT_EQUALS( iResult, KErrAlreadyExists ); |
|
187 EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); |
186 EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); |
188 |
187 |
189 // wait for destroy to finnish |
188 // wait for destroy to finnish |
190 iFactory->DestroyPlugin( info ); |
189 iFactory->DestroyPlugin( info ); |
191 iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); |
190 iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); |
192 iWait->Start(); |
191 iWait->Start(); |
193 EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) == NULL, ETrue ); |
192 EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) == NULL, ETrue ); |
194 EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 0 ); |
193 EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 0 ); |
195 |
194 |
196 // create 2 same and wait first to finnish. Second should return |
195 // create 2 same and wait first to finnish. |
197 // KErrAlreadyExists |
196 // Second won't be appended to load queue. |
198 iFactory->LoadPlugin( info ); |
197 iFactory->LoadPlugin( info ); |
199 iWait->Start(); |
198 iWait->Start(); |
200 EUNIT_ASSERT_EQUALS( iResult, KErrNone ); |
199 EUNIT_ASSERT_EQUALS( iResult, KErrNone ); |
201 EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); |
200 EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); |
202 |
201 |
203 iFactory->LoadPlugin( info ); |
202 iFactory->LoadPlugin( info ); |
204 iWait->Start(); |
|
205 EUNIT_ASSERT_EQUALS( iResult, KErrAlreadyExists ); |
|
206 EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); |
203 EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); |
207 |
204 |
208 // Test missing namespace |
205 // Test missing namespace |
209 TAiFwPublisherInfo missingInfo( missing, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); |
206 TAiFwPublisherInfo missingInfo( missing, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); |
210 iFactory->LoadPlugin( missingInfo ); |
207 iFactory->LoadPlugin( missingInfo ); |