Lines Matching full:background
64 // and delete objects on a background thread.
388 BackgroundThread background;
389 background.Start();
399 // Background thread creates WeakPtr(and implicitly owns the object).
400 background.CreateArrowFromTarget(&arrow, target);
401 EXPECT_EQ(background.DeRef(arrow), target);
409 // The new WeakPtr is owned by background thread.
410 EXPECT_EQ(target, background.DeRef(&arrow));
413 // Target can only be deleted on background thread.
414 background.DeleteTarget(target);
415 background.DeleteArrow(arrow);
419 BackgroundThread background;
420 background.Start();
425 // Background thread creates WeakPtr.
426 background.CreateArrowFromTarget(&arrow, &target);
428 // Bind to background thread.
429 EXPECT_EQ(&target, background.DeRef(arrow));
447 BackgroundThread background;
448 background.Start();
461 // Re-bind to background thread.
462 EXPECT_EQ(target.get(), background.DeRef(&arrow));
464 // And the background thread can now delete the target.
465 background.DeleteTarget(target.release());
471 // - Background thread creates a WeakPtr copy from the one in main thread
472 // - Destruct the WeakPtr on background thread
474 BackgroundThread background;
475 background.Start();
482 background.CreateArrowFromArrow(&arrow_copy, &arrow);
484 background.DeleteArrow(arrow_copy);
489 // - Main thread creates a WeakPtr and passes copy to background thread
491 // - Destruct the pointer on background thread
492 BackgroundThread background;
493 background.Start();
500 background.CreateArrowFromArrow(&arrow_copy, &arrow);
503 background.DeleteArrow(arrow_copy);
508 // - Main thread creates WeakPtr and passes Copy to background thread
510 // (invalidates WeakPtr on background thread)
512 BackgroundThread background;
513 background.Start();
519 background.CreateArrowFromArrow(&arrow_copy, &arrow);
522 background.DeleteArrow(arrow_copy);
532 // Background can copy and assign arrow (as well as the WeakPtr inside).
533 BackgroundThread background;
534 background.Start();
535 background.CopyAndAssignArrow(arrow);
536 background.DeleteArrow(arrow);
546 // Background can copy and assign arrow's WeakPtr to a base class WeakPtr.
547 BackgroundThread background;
548 background.Start();
549 background.CopyAndAssignArrowBase(arrow);
550 background.DeleteArrow(arrow);
560 // Background can delete arrow (as well as the WeakPtr inside).
561 BackgroundThread background;
562 background.Start();
563 background.DeleteArrow(arrow);
573 BackgroundThread background;
574 background.Start();
582 // Background copies the WeakPtr.
584 background.CreateArrowFromArrow(&arrow_copy, &arrow);
589 // Although background thread created the copy, it can not deref the copied
591 ASSERT_DEATH(background.DeRef(arrow_copy), "");
593 background.DeleteArrow(arrow_copy);
610 // Background thread tries to deref target, which violates thread ownership.
611 BackgroundThread background;
612 background.Start();
613 ASSERT_DEATH(background.DeRef(&arrow), "");
627 // Background thread tries to deref target, binding it to the thread.
628 BackgroundThread background;
629 background.Start();
630 background.DeRef(&arrow);
636 // must pass it to the background thread to teardown.
637 background.DeleteTarget(target.release());
653 // Background thread tries to delete target, volating thread binding.
654 BackgroundThread background;
655 background.Start();
656 ASSERT_DEATH(background.DeleteTarget(target.release()), "");
670 // Background thread tries to delete target, binding the object to the thread.
671 BackgroundThread background;
672 background.Start();
673 background.DeleteTarget(target.release());