CC: Fix call order of ScrollOffsetDelegate in ActivatePendingTree.

When a full tree synchronization happens, the ScrollOffsetDelegate
is called too early (i.e. before DidBecomeActive()) and sees always
a 0x0 scroll offset.
This CL swaps the call order of SetRootLayerScrollOffsetDelegate
and DidBecomeActive during the active tree activation in
LayerTreeHostImpl::ActivatePendingTree.
Updating also the unit tests to prevent future regressions
on the RootLayerScrollOffsetDelegate.

BUG=b/10959756
[email protected]

Review URL: https://codereview.chromium.org/25496002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226255 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index e60fa55..a764372 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1513,9 +1513,9 @@
   // next sync.
   pending_tree_.swap(recycle_tree_);
 
+  active_tree_->DidBecomeActive();
   active_tree_->SetRootLayerScrollOffsetDelegate(
       root_layer_scroll_offset_delegate_);
-  active_tree_->DidBecomeActive();
 
   // Reduce wasted memory now that unlinked resources are guaranteed not
   // to be used.