add copyToData() to dyanamicwstream



git-svn-id: http://skia.googlecode.com/svn/trunk@1695 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index e62f2ed..9aaa8b4 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -1,6 +1,7 @@
 #include "Test.h"
 #include "SkRandom.h"
 #include "SkStream.h"
+#include "SkDataRef.h"
 
 #define MAX_SIZE    (256 * 1024)
 
@@ -82,6 +83,13 @@
         REPORTER_ASSERT(reporter, memcmp(&dst[i * 26], s, 26) == 0);
     }
     REPORTER_ASSERT(reporter, memcmp(dst, ds.getStream(), 100*26) == 0);
+
+    {
+        SkDataRef* data = ds.copyToData();
+        REPORTER_ASSERT(reporter, 100 * 26 == data->size());
+        REPORTER_ASSERT(reporter, memcmp(dst, data->data(), data->size()) == 0);
+        data->unref();
+    }
     delete[] dst;
 }