Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(878)

Side by Side Diff: chrome/browser/user_style_sheet_watcher_unittest.cc

Issue 668250: Fix a memory leak in the new unittest. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698