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

Side by Side Diff: chrome/browser/chromeos/login/resource_loader_browsertest.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" 11 #include "chrome/browser/ui/tabs/tab_strip_model.h"
12 #include "chrome/common/chrome_switches.h" 12 #include "chrome/common/chrome_switches.h"
13 #include "chrome/test/base/in_process_browser_test.h" 13 #include "chrome/test/base/in_process_browser_test.h"
14 #include "chrome/test/base/ui_test_utils.h" 14 #include "chrome/test/base/ui_test_utils.h"
15 #include "content/public/browser/navigation_details.h" 15 #include "content/public/browser/navigation_details.h"
16 #include "content/public/test/browser_test_utils.h" 16 #include "content/public/test/browser_test_utils.h"
17 #include "grit/browser_resources.h" 17 #include "grit/browser_resources.h"
18 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
19 #include "url/gurl.h" 19 #include "url/gurl.h"
20 20
21 namespace { 21 namespace {
22 22
23 GURL CreateResource(const std::string& content) { 23 GURL CreateResource(const std::string& content) {
24 base::FilePath path; 24 base::FilePath path;
25 EXPECT_TRUE(base::CreateTemporaryFile(&path)); 25 EXPECT_TRUE(base::CreateTemporaryFile(&path));
26 EXPECT_TRUE(file_util::WriteFile(path, content.c_str(), content.size())); 26 EXPECT_TRUE(base::WriteFile(path, content.c_str(), content.size()));
27 return GURL("file:///" + path.AsUTF8Unsafe()); 27 return GURL("file:///" + path.AsUTF8Unsafe());
28 } 28 }
29 29
30 // Test the CrOS login screen resource loading mechanism. 30 // Test the CrOS login screen resource loading mechanism.
31 class ResourceLoaderBrowserTest : public InProcessBrowserTest { 31 class ResourceLoaderBrowserTest : public InProcessBrowserTest {
32 public: 32 public:
33 ResourceLoaderBrowserTest() {} 33 ResourceLoaderBrowserTest() {}
34 34
35 protected: 35 protected:
36 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 36 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 JSExpect("!!document.querySelector('div#root h1#bar')"); 128 JSExpect("!!document.querySelector('div#root h1#bar')");
129 129
130 // Check that the JS was loaded and evaluated. 130 // Check that the JS was loaded and evaluated.
131 JSExpect("stuff.loaded"); 131 JSExpect("stuff.loaded");
132 132
133 // Check that the styles were loaded. 133 // Check that the styles were loaded.
134 JSExpect("!!document.head.querySelector('link').innerHTML.indexOf('red')"); 134 JSExpect("!!document.head.querySelector('link').innerHTML.indexOf('red')");
135 } 135 }
136 136
137 } // namespace 137 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698