| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/user_style_sheet_watcher.h" | 5 #include "chrome/browser/user_style_sheet_watcher.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 loop.RunAllPending(); | 33 loop.RunAllPending(); |
| 34 | 34 |
| 35 GURL result_url = style_sheet_watcher->user_style_sheet(); | 35 GURL result_url = style_sheet_watcher->user_style_sheet(); |
| 36 std::string result = result_url.spec(); | 36 std::string result = result_url.spec(); |
| 37 std::string prefix = "data:text/css;charset=utf-8;base64,"; | 37 std::string prefix = "data:text/css;charset=utf-8;base64,"; |
| 38 EXPECT_TRUE(StartsWithASCII(result, prefix, true)); | 38 EXPECT_TRUE(StartsWithASCII(result, prefix, true)); |
| 39 result = result.substr(prefix.length()); | 39 result = result.substr(prefix.length()); |
| 40 std::string decoded; | 40 std::string decoded; |
| 41 EXPECT_TRUE(base::Base64Decode(result, &decoded)); | 41 EXPECT_TRUE(base::Base64Decode(result, &decoded)); |
| 42 EXPECT_EQ(css_file_contents, decoded); | 42 EXPECT_EQ(css_file_contents, decoded); |
| 43 style_sheet_watcher = NULL; |
| 43 } | 44 } |
| OLD | NEW |