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

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

Issue 179032: Enable extensions by default. (Closed)
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
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
42 FilePath filename(test_data_directory_); 40 FilePath filename(test_data_directory_);
43 filename = filename.AppendASCII(extension_path); 41 filename = filename.AppendASCII(extension_path);
44 launch_arguments_.AppendSwitchWithValue(switches::kLoadExtension, 42 launch_arguments_.AppendSwitchWithValue(switches::kLoadExtension,
45 filename.value()); 43 filename.value());
46 } 44 }
47 45
48 void SetUp() { 46 void SetUp() {
49 ParentTestType::SetUp(); 47 ParentTestType::SetUp();
50 automation()->SetEnableExtensionAutomation(true); 48 automation()->SetEnableExtensionAutomation(true);
51 } 49 }
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 proxy->event_count_.size()); 495 proxy->event_count_.size());
498 for (std::map<std::string, int>::iterator i = proxy->event_count_.begin(); 496 for (std::map<std::string, int>::iterator i = proxy->event_count_.begin();
499 i != proxy->event_count_.end(); ++i) { 497 i != proxy->event_count_.end(); ++i) {
500 const std::pair<std::string, int>& value = *i; 498 const std::pair<std::string, int>& value = *i;
501 ASSERT_EQ(1, value.second); 499 ASSERT_EQ(1, value.second);
502 } 500 }
503 } 501 }
504 #endif // defined(OS_WIN) 502 #endif // defined(OS_WIN)
505 503
506 } // namespace 504 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698