| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 }; | 500 }; |
| 501 | 501 |
| 502 #if CANVAS2D_HIBERNATION_ENABLED | 502 #if CANVAS2D_HIBERNATION_ENABLED |
| 503 TEST_F(Canvas2DLayerBridgeTest, HibernationLifeCycle) | 503 TEST_F(Canvas2DLayerBridgeTest, HibernationLifeCycle) |
| 504 #else | 504 #else |
| 505 TEST_F(Canvas2DLayerBridgeTest, DISABLED_HibernationLifeCycle) | 505 TEST_F(Canvas2DLayerBridgeTest, DISABLED_HibernationLifeCycle) |
| 506 #endif | 506 #endif |
| 507 { | 507 { |
| 508 FakeGLES2Interface gl; | 508 FakeGLES2Interface gl; |
| 509 std::unique_ptr<WebThread> test_thread = | 509 std::unique_ptr<WebThread> test_thread = |
| 510 Platform::Current()->CreateThread("TestThread"); | 510 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 511 | 511 |
| 512 // The Canvas2DLayerBridge has to be created on the thread that will use it | 512 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 513 // to avoid WeakPtr thread check issues. | 513 // to avoid WeakPtr thread check issues. |
| 514 Canvas2DLayerBridgePtr bridge; | 514 Canvas2DLayerBridgePtr bridge; |
| 515 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 515 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 516 this); | 516 this); |
| 517 | 517 |
| 518 // Register an alternate Logger for tracking hibernation events | 518 // Register an alternate Logger for tracking hibernation events |
| 519 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 519 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 520 MockLogger* mock_logger_ptr = mock_logger.get(); | 520 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 } | 553 } |
| 554 | 554 |
| 555 #if CANVAS2D_HIBERNATION_ENABLED | 555 #if CANVAS2D_HIBERNATION_ENABLED |
| 556 TEST_F(Canvas2DLayerBridgeTest, HibernationReEntry) | 556 TEST_F(Canvas2DLayerBridgeTest, HibernationReEntry) |
| 557 #else | 557 #else |
| 558 TEST_F(Canvas2DLayerBridgeTest, DISABLED_HibernationReEntry) | 558 TEST_F(Canvas2DLayerBridgeTest, DISABLED_HibernationReEntry) |
| 559 #endif | 559 #endif |
| 560 { | 560 { |
| 561 FakeGLES2Interface gl; | 561 FakeGLES2Interface gl; |
| 562 std::unique_ptr<WebThread> test_thread = | 562 std::unique_ptr<WebThread> test_thread = |
| 563 Platform::Current()->CreateThread("TestThread"); | 563 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 564 | 564 |
| 565 // The Canvas2DLayerBridge has to be created on the thread that will use it | 565 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 566 // to avoid WeakPtr thread check issues. | 566 // to avoid WeakPtr thread check issues. |
| 567 Canvas2DLayerBridgePtr bridge; | 567 Canvas2DLayerBridgePtr bridge; |
| 568 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 568 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 569 this); | 569 this); |
| 570 | 570 |
| 571 // Register an alternate Logger for tracking hibernation events | 571 // Register an alternate Logger for tracking hibernation events |
| 572 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 572 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 573 MockLogger* mock_logger_ptr = mock_logger.get(); | 573 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 #if CANVAS2D_HIBERNATION_ENABLED | 613 #if CANVAS2D_HIBERNATION_ENABLED |
| 614 TEST_F(Canvas2DLayerBridgeTest, | 614 TEST_F(Canvas2DLayerBridgeTest, |
| 615 HibernationLifeCycleWithDeferredRenderingDisabled) | 615 HibernationLifeCycleWithDeferredRenderingDisabled) |
| 616 #else | 616 #else |
| 617 TEST_F(Canvas2DLayerBridgeTest, | 617 TEST_F(Canvas2DLayerBridgeTest, |
| 618 DISABLED_HibernationLifeCycleWithDeferredRenderingDisabled) | 618 DISABLED_HibernationLifeCycleWithDeferredRenderingDisabled) |
| 619 #endif | 619 #endif |
| 620 { | 620 { |
| 621 FakeGLES2Interface gl; | 621 FakeGLES2Interface gl; |
| 622 std::unique_ptr<WebThread> test_thread = | 622 std::unique_ptr<WebThread> test_thread = |
| 623 Platform::Current()->CreateThread("TestThread"); | 623 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 624 | 624 |
| 625 // The Canvas2DLayerBridge has to be created on the thread that will use it | 625 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 626 // to avoid WeakPtr thread check issues. | 626 // to avoid WeakPtr thread check issues. |
| 627 Canvas2DLayerBridgePtr bridge; | 627 Canvas2DLayerBridgePtr bridge; |
| 628 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 628 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 629 this); | 629 this); |
| 630 bridge->DisableDeferral(kDisableDeferralReasonUnknown); | 630 bridge->DisableDeferral(kDisableDeferralReasonUnknown); |
| 631 MockImageBuffer mock_image_buffer; | 631 MockImageBuffer mock_image_buffer; |
| 632 EXPECT_CALL(mock_image_buffer, ResetCanvas(_)).Times(AnyNumber()); | 632 EXPECT_CALL(mock_image_buffer, ResetCanvas(_)).Times(AnyNumber()); |
| 633 bridge->SetImageBuffer(&mock_image_buffer); | 633 bridge->SetImageBuffer(&mock_image_buffer); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 } | 692 } |
| 693 | 693 |
| 694 #if CANVAS2D_HIBERNATION_ENABLED && CANVAS2D_BACKGROUND_RENDER_SWITCH_TO_CPU | 694 #if CANVAS2D_HIBERNATION_ENABLED && CANVAS2D_BACKGROUND_RENDER_SWITCH_TO_CPU |
| 695 TEST_F(Canvas2DLayerBridgeTest, BackgroundRenderingWhileHibernating) | 695 TEST_F(Canvas2DLayerBridgeTest, BackgroundRenderingWhileHibernating) |
| 696 #else | 696 #else |
| 697 TEST_F(Canvas2DLayerBridgeTest, DISABLED_BackgroundRenderingWhileHibernating) | 697 TEST_F(Canvas2DLayerBridgeTest, DISABLED_BackgroundRenderingWhileHibernating) |
| 698 #endif | 698 #endif |
| 699 { | 699 { |
| 700 FakeGLES2Interface gl; | 700 FakeGLES2Interface gl; |
| 701 std::unique_ptr<WebThread> test_thread = | 701 std::unique_ptr<WebThread> test_thread = |
| 702 Platform::Current()->CreateThread("TestThread"); | 702 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 703 | 703 |
| 704 // The Canvas2DLayerBridge has to be created on the thread that will use it | 704 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 705 // to avoid WeakPtr thread check issues. | 705 // to avoid WeakPtr thread check issues. |
| 706 Canvas2DLayerBridgePtr bridge; | 706 Canvas2DLayerBridgePtr bridge; |
| 707 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 707 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 708 this); | 708 this); |
| 709 | 709 |
| 710 // Register an alternate Logger for tracking hibernation events | 710 // Register an alternate Logger for tracking hibernation events |
| 711 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 711 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 712 MockLogger* mock_logger_ptr = mock_logger.get(); | 712 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 TEST_F(Canvas2DLayerBridgeTest, | 757 TEST_F(Canvas2DLayerBridgeTest, |
| 758 BackgroundRenderingWhileHibernatingWithDeferredRenderingDisabled) | 758 BackgroundRenderingWhileHibernatingWithDeferredRenderingDisabled) |
| 759 #else | 759 #else |
| 760 TEST_F( | 760 TEST_F( |
| 761 Canvas2DLayerBridgeTest, | 761 Canvas2DLayerBridgeTest, |
| 762 DISABLED_BackgroundRenderingWhileHibernatingWithDeferredRenderingDisabled) | 762 DISABLED_BackgroundRenderingWhileHibernatingWithDeferredRenderingDisabled) |
| 763 #endif | 763 #endif |
| 764 { | 764 { |
| 765 FakeGLES2Interface gl; | 765 FakeGLES2Interface gl; |
| 766 std::unique_ptr<WebThread> test_thread = | 766 std::unique_ptr<WebThread> test_thread = |
| 767 Platform::Current()->CreateThread("TestThread"); | 767 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 768 | 768 |
| 769 // The Canvas2DLayerBridge has to be created on the thread that will use it | 769 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 770 // to avoid WeakPtr thread check issues. | 770 // to avoid WeakPtr thread check issues. |
| 771 Canvas2DLayerBridgePtr bridge; | 771 Canvas2DLayerBridgePtr bridge; |
| 772 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 772 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 773 this); | 773 this); |
| 774 MockImageBuffer mock_image_buffer; | 774 MockImageBuffer mock_image_buffer; |
| 775 EXPECT_CALL(mock_image_buffer, ResetCanvas(_)).Times(AnyNumber()); | 775 EXPECT_CALL(mock_image_buffer, ResetCanvas(_)).Times(AnyNumber()); |
| 776 bridge->SetImageBuffer(&mock_image_buffer); | 776 bridge->SetImageBuffer(&mock_image_buffer); |
| 777 bridge->DisableDeferral(kDisableDeferralReasonUnknown); | 777 bridge->DisableDeferral(kDisableDeferralReasonUnknown); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 | 830 |
| 831 #if CANVAS2D_HIBERNATION_ENABLED && CANVAS2D_BACKGROUND_RENDER_SWITCH_TO_CPU | 831 #if CANVAS2D_HIBERNATION_ENABLED && CANVAS2D_BACKGROUND_RENDER_SWITCH_TO_CPU |
| 832 TEST_F(Canvas2DLayerBridgeTest, DisableDeferredRenderingWhileHibernating) | 832 TEST_F(Canvas2DLayerBridgeTest, DisableDeferredRenderingWhileHibernating) |
| 833 #else | 833 #else |
| 834 TEST_F(Canvas2DLayerBridgeTest, | 834 TEST_F(Canvas2DLayerBridgeTest, |
| 835 DISABLED_DisableDeferredRenderingWhileHibernating) | 835 DISABLED_DisableDeferredRenderingWhileHibernating) |
| 836 #endif | 836 #endif |
| 837 { | 837 { |
| 838 FakeGLES2Interface gl; | 838 FakeGLES2Interface gl; |
| 839 std::unique_ptr<WebThread> test_thread = | 839 std::unique_ptr<WebThread> test_thread = |
| 840 Platform::Current()->CreateThread("TestThread"); | 840 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 841 | 841 |
| 842 // The Canvas2DLayerBridge has to be created on the thread that will use it | 842 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 843 // to avoid WeakPtr thread check issues. | 843 // to avoid WeakPtr thread check issues. |
| 844 Canvas2DLayerBridgePtr bridge; | 844 Canvas2DLayerBridgePtr bridge; |
| 845 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 845 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 846 this); | 846 this); |
| 847 MockImageBuffer mock_image_buffer; | 847 MockImageBuffer mock_image_buffer; |
| 848 EXPECT_CALL(mock_image_buffer, ResetCanvas(_)).Times(AnyNumber()); | 848 EXPECT_CALL(mock_image_buffer, ResetCanvas(_)).Times(AnyNumber()); |
| 849 bridge->SetImageBuffer(&mock_image_buffer); | 849 bridge->SetImageBuffer(&mock_image_buffer); |
| 850 | 850 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 } | 901 } |
| 902 | 902 |
| 903 #if CANVAS2D_HIBERNATION_ENABLED | 903 #if CANVAS2D_HIBERNATION_ENABLED |
| 904 TEST_F(Canvas2DLayerBridgeTest, TeardownWhileHibernating) | 904 TEST_F(Canvas2DLayerBridgeTest, TeardownWhileHibernating) |
| 905 #else | 905 #else |
| 906 TEST_F(Canvas2DLayerBridgeTest, DISABLED_TeardownWhileHibernating) | 906 TEST_F(Canvas2DLayerBridgeTest, DISABLED_TeardownWhileHibernating) |
| 907 #endif | 907 #endif |
| 908 { | 908 { |
| 909 FakeGLES2Interface gl; | 909 FakeGLES2Interface gl; |
| 910 std::unique_ptr<WebThread> test_thread = | 910 std::unique_ptr<WebThread> test_thread = |
| 911 Platform::Current()->CreateThread("TestThread"); | 911 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 912 | 912 |
| 913 // The Canvas2DLayerBridge has to be created on the thread that will use it | 913 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 914 // to avoid WeakPtr thread check issues. | 914 // to avoid WeakPtr thread check issues. |
| 915 Canvas2DLayerBridgePtr bridge; | 915 Canvas2DLayerBridgePtr bridge; |
| 916 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 916 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 917 this); | 917 this); |
| 918 | 918 |
| 919 // Register an alternate Logger for tracking hibernation events | 919 // Register an alternate Logger for tracking hibernation events |
| 920 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 920 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 921 MockLogger* mock_logger_ptr = mock_logger.get(); | 921 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 945 } | 945 } |
| 946 | 946 |
| 947 #if CANVAS2D_HIBERNATION_ENABLED | 947 #if CANVAS2D_HIBERNATION_ENABLED |
| 948 TEST_F(Canvas2DLayerBridgeTest, SnapshotWhileHibernating) | 948 TEST_F(Canvas2DLayerBridgeTest, SnapshotWhileHibernating) |
| 949 #else | 949 #else |
| 950 TEST_F(Canvas2DLayerBridgeTest, DISABLED_SnapshotWhileHibernating) | 950 TEST_F(Canvas2DLayerBridgeTest, DISABLED_SnapshotWhileHibernating) |
| 951 #endif | 951 #endif |
| 952 { | 952 { |
| 953 FakeGLES2Interface gl; | 953 FakeGLES2Interface gl; |
| 954 std::unique_ptr<WebThread> test_thread = | 954 std::unique_ptr<WebThread> test_thread = |
| 955 Platform::Current()->CreateThread("TestThread"); | 955 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 956 | 956 |
| 957 // The Canvas2DLayerBridge has to be created on the thread that will use it | 957 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 958 // to avoid WeakPtr thread check issues. | 958 // to avoid WeakPtr thread check issues. |
| 959 Canvas2DLayerBridgePtr bridge; | 959 Canvas2DLayerBridgePtr bridge; |
| 960 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 960 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 961 this); | 961 this); |
| 962 | 962 |
| 963 // Register an alternate Logger for tracking hibernation events | 963 // Register an alternate Logger for tracking hibernation events |
| 964 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 964 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 965 MockLogger* mock_logger_ptr = mock_logger.get(); | 965 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 } | 1008 } |
| 1009 | 1009 |
| 1010 #if CANVAS2D_HIBERNATION_ENABLED | 1010 #if CANVAS2D_HIBERNATION_ENABLED |
| 1011 TEST_F(Canvas2DLayerBridgeTest, TeardownWhileHibernationIsPending) | 1011 TEST_F(Canvas2DLayerBridgeTest, TeardownWhileHibernationIsPending) |
| 1012 #else | 1012 #else |
| 1013 TEST_F(Canvas2DLayerBridgeTest, DISABLED_TeardownWhileHibernationIsPending) | 1013 TEST_F(Canvas2DLayerBridgeTest, DISABLED_TeardownWhileHibernationIsPending) |
| 1014 #endif | 1014 #endif |
| 1015 { | 1015 { |
| 1016 FakeGLES2Interface gl; | 1016 FakeGLES2Interface gl; |
| 1017 std::unique_ptr<WebThread> test_thread = | 1017 std::unique_ptr<WebThread> test_thread = |
| 1018 Platform::Current()->CreateThread("TestThread"); | 1018 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 1019 | 1019 |
| 1020 // The Canvas2DLayerBridge has to be created on the thread that will use it | 1020 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 1021 // to avoid WeakPtr thread check issues. | 1021 // to avoid WeakPtr thread check issues. |
| 1022 Canvas2DLayerBridgePtr bridge; | 1022 Canvas2DLayerBridgePtr bridge; |
| 1023 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 1023 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 1024 this); | 1024 this); |
| 1025 | 1025 |
| 1026 // Register an alternate Logger for tracking hibernation events | 1026 // Register an alternate Logger for tracking hibernation events |
| 1027 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 1027 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 1028 MockLogger* mock_logger_ptr = mock_logger.get(); | 1028 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 #if CANVAS2D_HIBERNATION_ENABLED | 1058 #if CANVAS2D_HIBERNATION_ENABLED |
| 1059 TEST_F(Canvas2DLayerBridgeTest, HibernationAbortedDueToPendingTeardown) | 1059 TEST_F(Canvas2DLayerBridgeTest, HibernationAbortedDueToPendingTeardown) |
| 1060 #else | 1060 #else |
| 1061 TEST_F(Canvas2DLayerBridgeTest, DISABLED_HibernationAbortedDueToPendingTeardown) | 1061 TEST_F(Canvas2DLayerBridgeTest, DISABLED_HibernationAbortedDueToPendingTeardown) |
| 1062 #endif | 1062 #endif |
| 1063 { | 1063 { |
| 1064 FakeGLES2Interface gl; | 1064 FakeGLES2Interface gl; |
| 1065 std::unique_ptr<WebThread> test_thread = | 1065 std::unique_ptr<WebThread> test_thread = |
| 1066 Platform::Current()->CreateThread("TestThread"); | 1066 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 1067 | 1067 |
| 1068 // The Canvas2DLayerBridge has to be created on the thread that will use it | 1068 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 1069 // to avoid WeakPtr thread check issues. | 1069 // to avoid WeakPtr thread check issues. |
| 1070 Canvas2DLayerBridgePtr bridge; | 1070 Canvas2DLayerBridgePtr bridge; |
| 1071 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 1071 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 1072 this); | 1072 this); |
| 1073 | 1073 |
| 1074 // Register an alternate Logger for tracking hibernation events | 1074 // Register an alternate Logger for tracking hibernation events |
| 1075 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 1075 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 1076 MockLogger* mock_logger_ptr = mock_logger.get(); | 1076 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1102 | 1102 |
| 1103 #if CANVAS2D_HIBERNATION_ENABLED | 1103 #if CANVAS2D_HIBERNATION_ENABLED |
| 1104 TEST_F(Canvas2DLayerBridgeTest, HibernationAbortedDueToVisibilityChange) | 1104 TEST_F(Canvas2DLayerBridgeTest, HibernationAbortedDueToVisibilityChange) |
| 1105 #else | 1105 #else |
| 1106 TEST_F(Canvas2DLayerBridgeTest, | 1106 TEST_F(Canvas2DLayerBridgeTest, |
| 1107 DISABLED_HibernationAbortedDueToVisibilityChange) | 1107 DISABLED_HibernationAbortedDueToVisibilityChange) |
| 1108 #endif | 1108 #endif |
| 1109 { | 1109 { |
| 1110 FakeGLES2Interface gl; | 1110 FakeGLES2Interface gl; |
| 1111 std::unique_ptr<WebThread> test_thread = | 1111 std::unique_ptr<WebThread> test_thread = |
| 1112 Platform::Current()->CreateThread("TestThread"); | 1112 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 1113 | 1113 |
| 1114 // The Canvas2DLayerBridge has to be created on the thread that will use it | 1114 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 1115 // to avoid WeakPtr thread check issues. | 1115 // to avoid WeakPtr thread check issues. |
| 1116 Canvas2DLayerBridgePtr bridge; | 1116 Canvas2DLayerBridgePtr bridge; |
| 1117 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 1117 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 1118 this); | 1118 this); |
| 1119 | 1119 |
| 1120 // Register an alternate Logger for tracking hibernation events | 1120 // Register an alternate Logger for tracking hibernation events |
| 1121 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 1121 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 1122 MockLogger* mock_logger_ptr = mock_logger.get(); | 1122 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1148 } | 1148 } |
| 1149 | 1149 |
| 1150 #if CANVAS2D_HIBERNATION_ENABLED | 1150 #if CANVAS2D_HIBERNATION_ENABLED |
| 1151 TEST_F(Canvas2DLayerBridgeTest, HibernationAbortedDueToLostContext) | 1151 TEST_F(Canvas2DLayerBridgeTest, HibernationAbortedDueToLostContext) |
| 1152 #else | 1152 #else |
| 1153 TEST_F(Canvas2DLayerBridgeTest, DISABLED_HibernationAbortedDueToLostContext) | 1153 TEST_F(Canvas2DLayerBridgeTest, DISABLED_HibernationAbortedDueToLostContext) |
| 1154 #endif | 1154 #endif |
| 1155 { | 1155 { |
| 1156 FakeGLES2Interface gl; | 1156 FakeGLES2Interface gl; |
| 1157 std::unique_ptr<WebThread> test_thread = | 1157 std::unique_ptr<WebThread> test_thread = |
| 1158 Platform::Current()->CreateThread("TestThread"); | 1158 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 1159 | 1159 |
| 1160 // The Canvas2DLayerBridge has to be created on the thread that will use it | 1160 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 1161 // to avoid WeakPtr thread check issues. | 1161 // to avoid WeakPtr thread check issues. |
| 1162 Canvas2DLayerBridgePtr bridge; | 1162 Canvas2DLayerBridgePtr bridge; |
| 1163 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 1163 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 1164 this); | 1164 this); |
| 1165 | 1165 |
| 1166 // Register an alternate Logger for tracking hibernation events | 1166 // Register an alternate Logger for tracking hibernation events |
| 1167 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 1167 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 1168 MockLogger* mock_logger_ptr = mock_logger.get(); | 1168 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 #if CANVAS2D_HIBERNATION_ENABLED | 1193 #if CANVAS2D_HIBERNATION_ENABLED |
| 1194 TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxWhileHibernating) | 1194 TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxWhileHibernating) |
| 1195 #else | 1195 #else |
| 1196 TEST_F(Canvas2DLayerBridgeTest, DISABLED_PrepareMailboxWhileHibernating) | 1196 TEST_F(Canvas2DLayerBridgeTest, DISABLED_PrepareMailboxWhileHibernating) |
| 1197 #endif | 1197 #endif |
| 1198 { | 1198 { |
| 1199 FakeGLES2Interface gl; | 1199 FakeGLES2Interface gl; |
| 1200 std::unique_ptr<WebThread> test_thread = | 1200 std::unique_ptr<WebThread> test_thread = |
| 1201 Platform::Current()->CreateThread("TestThread"); | 1201 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 1202 | 1202 |
| 1203 // The Canvas2DLayerBridge has to be created on the thread that will use it | 1203 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 1204 // to avoid WeakPtr thread check issues. | 1204 // to avoid WeakPtr thread check issues. |
| 1205 Canvas2DLayerBridgePtr bridge; | 1205 Canvas2DLayerBridgePtr bridge; |
| 1206 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 1206 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 1207 this); | 1207 this); |
| 1208 | 1208 |
| 1209 // Register an alternate Logger for tracking hibernation events | 1209 // Register an alternate Logger for tracking hibernation events |
| 1210 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 1210 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 1211 MockLogger* mock_logger_ptr = mock_logger.get(); | 1211 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1240 } | 1240 } |
| 1241 | 1241 |
| 1242 #if CANVAS2D_HIBERNATION_ENABLED && CANVAS2D_BACKGROUND_RENDER_SWITCH_TO_CPU | 1242 #if CANVAS2D_HIBERNATION_ENABLED && CANVAS2D_BACKGROUND_RENDER_SWITCH_TO_CPU |
| 1243 TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxWhileBackgroundRendering) | 1243 TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxWhileBackgroundRendering) |
| 1244 #else | 1244 #else |
| 1245 TEST_F(Canvas2DLayerBridgeTest, DISABLED_PrepareMailboxWhileBackgroundRendering) | 1245 TEST_F(Canvas2DLayerBridgeTest, DISABLED_PrepareMailboxWhileBackgroundRendering) |
| 1246 #endif | 1246 #endif |
| 1247 { | 1247 { |
| 1248 FakeGLES2Interface gl; | 1248 FakeGLES2Interface gl; |
| 1249 std::unique_ptr<WebThread> test_thread = | 1249 std::unique_ptr<WebThread> test_thread = |
| 1250 Platform::Current()->CreateThread("TestThread"); | 1250 WTF::WrapUnique(Platform::Current()->CreateThread("TestThread")); |
| 1251 | 1251 |
| 1252 // The Canvas2DLayerBridge has to be created on the thread that will use it | 1252 // The Canvas2DLayerBridge has to be created on the thread that will use it |
| 1253 // to avoid WeakPtr thread check issues. | 1253 // to avoid WeakPtr thread check issues. |
| 1254 Canvas2DLayerBridgePtr bridge; | 1254 Canvas2DLayerBridgePtr bridge; |
| 1255 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, | 1255 PostAndWaitCreateBridgeTask(BLINK_FROM_HERE, test_thread.get(), &bridge, &gl, |
| 1256 this); | 1256 this); |
| 1257 | 1257 |
| 1258 // Register an alternate Logger for tracking hibernation events | 1258 // Register an alternate Logger for tracking hibernation events |
| 1259 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); | 1259 std::unique_ptr<MockLogger> mock_logger = WTF::WrapUnique(new MockLogger); |
| 1260 MockLogger* mock_logger_ptr = mock_logger.get(); | 1260 MockLogger* mock_logger_ptr = mock_logger.get(); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); | 1379 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); |
| 1380 ::testing::Mock::VerifyAndClearExpectations(&gl); | 1380 ::testing::Mock::VerifyAndClearExpectations(&gl); |
| 1381 | 1381 |
| 1382 EXPECT_CALL(gl, Flush()).Times(1); | 1382 EXPECT_CALL(gl, Flush()).Times(1); |
| 1383 bridge->FlushGpu(); | 1383 bridge->FlushGpu(); |
| 1384 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); | 1384 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); |
| 1385 ::testing::Mock::VerifyAndClearExpectations(&gl); | 1385 ::testing::Mock::VerifyAndClearExpectations(&gl); |
| 1386 } | 1386 } |
| 1387 | 1387 |
| 1388 } // namespace blink | 1388 } // namespace blink |
| OLD | NEW |