pull code out for testing for idiomatic dart

BUG=

Review URL: https://chromiumcodereview.appspot.com//13331005