Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / cc / layers / texture_layer_unittest.cc
index 0a52968..08309c7 100644 (file)
@@ -52,7 +52,7 @@ class MockLayerTreeHost : public LayerTreeHost {
  public:
   explicit MockLayerTreeHost(FakeLayerTreeHostClient* client)
       : LayerTreeHost(client, NULL, LayerTreeSettings()) {
-    InitializeSingleThreaded(client);
+    InitializeSingleThreaded(client, base::MessageLoopProxy::current());
   }
 
   MOCK_METHOD0(SetNeedsCommit, void());
@@ -856,16 +856,25 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest {
 
   virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
     switch (host_impl->active_tree()->source_frame_number()) {
-      case 2: {
+      case 0: {
+        // The activate for the 1st mailbox should have happened before now.
+        EXPECT_EQ(1, activate_count_);
+        break;
+      }
+      case 1: {
         // The activate for the 2nd mailbox should have happened before now.
         EXPECT_EQ(2, activate_count_);
         break;
       }
-      case 3: {
+      case 2: {
         // The activate to remove the layer should have happened before now.
         EXPECT_EQ(3, activate_count_);
         break;
       }
+      case 3: {
+        NOTREACHED();
+        break;
+      }
     }
   }
 
@@ -1143,7 +1152,7 @@ class TextureLayerNoExtraCommitForMailboxTest
   virtual void DidCommitAndDrawFrame() OVERRIDE {
     switch (layer_tree_host()->source_frame_number()) {
       case 1:
-        EXPECT_FALSE(proxy()->CommitPendingForTesting());
+        EXPECT_FALSE(proxy()->MainFrameWillHappenForTesting());
         // Invalidate the texture layer to clear the mailbox before
         // ending the test.
         texture_layer_->SetNeedsDisplay();