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

Side by Side Diff: chrome/browser/extensions/extension_uitest.cc

Issue 190010: Revert 24846 - Enable extensions by default.... (Closed) Base URL: svn://chrome-svn/chrome/branches/205/src/
Patch Set: Created 11 years, 3 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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/gfx/rect.h" 6 #include "base/gfx/rect.h"
7 #include "base/json_reader.h" 7 #include "base/json_reader.h"
8 #include "base/json_writer.h" 8 #include "base/json_writer.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/automation/extension_automation_constants.h" 10 #include "chrome/browser/automation/extension_automation_constants.h"
(...skipping 19 matching lines...) Expand all
30 // startup, manifest parsing, and the actual process model in the 30 // startup, manifest parsing, and the actual process model in the
31 // equation. This would also let you write UITests that test individual 31 // equation. This would also let you write UITests that test individual
32 // Chrome Extensions as running in Chrome. Takes over implementation of 32 // Chrome Extensions as running in Chrome. Takes over implementation of
33 // extension API calls so that behavior can be tested deterministically 33 // extension API calls so that behavior can be tested deterministically
34 // through code, instead of having to contort the browser into a state 34 // through code, instead of having to contort the browser into a state
35 // suitable for testing. 35 // suitable for testing.
36 template <class ParentTestType> 36 template <class ParentTestType>
37 class ExtensionUITest : public ParentTestType { 37 class ExtensionUITest : public ParentTestType {
38 public: 38 public:
39 explicit ExtensionUITest(const std::string& extension_path) { 39 explicit ExtensionUITest(const std::string& extension_path) {
40 launch_arguments_.AppendSwitch(switches::kEnableExtensions);
41
40 FilePath filename(test_data_directory_); 42 FilePath filename(test_data_directory_);
41 filename = filename.AppendASCII(extension_path); 43 filename = filename.AppendASCII(extension_path);
42 launch_arguments_.AppendSwitchWithValue(switches::kLoadExtension, 44 launch_arguments_.AppendSwitchWithValue(switches::kLoadExtension,
43 filename.value()); 45 filename.value());
44 } 46 }
45 47
46 void SetUp() { 48 void SetUp() {
47 ParentTestType::SetUp(); 49 ParentTestType::SetUp();
48 automation()->SetEnableExtensionAutomation(true); 50 automation()->SetEnableExtensionAutomation(true);
49 } 51 }
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 proxy->event_count_.size()); 497 proxy->event_count_.size());
496 for (std::map<std::string, int>::iterator i = proxy->event_count_.begin(); 498 for (std::map<std::string, int>::iterator i = proxy->event_count_.begin();
497 i != proxy->event_count_.end(); ++i) { 499 i != proxy->event_count_.end(); ++i) {
498 const std::pair<std::string, int>& value = *i; 500 const std::pair<std::string, int>& value = *i;
499 ASSERT_EQ(1, value.second); 501 ASSERT_EQ(1, value.second);
500 } 502 }
501 } 503 }
502 #endif // defined(OS_WIN) 504 #endif // defined(OS_WIN)
503 505
504 } // namespace 506 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_startup_unittest.cc ('k') | chrome/browser/extensions/extensions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698