summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/automation/automation_provider_list.cc2
-rw-r--r--chrome/browser/automation/automation_provider_list.h1
-rw-r--r--chrome/browser/automation/automation_provider_list_generic.cc8
-rw-r--r--chrome/browser/automation/automation_provider_list_mac.mm13
-rw-r--r--chrome/browser/browser.scons8
-rw-r--r--chrome/browser/browser.vcproj4
-rw-r--r--chrome/chrome.gyp78
-rw-r--r--chrome/common/chrome_constants.cc9
-rw-r--r--chrome/test/startup/startup_test.cc4
9 files changed, 80 insertions, 47 deletions
diff --git a/chrome/browser/automation/automation_provider_list.cc b/chrome/browser/automation/automation_provider_list.cc
index 4fbc395..9597e7a 100644
--- a/chrome/browser/automation/automation_provider_list.cc
+++ b/chrome/browser/automation/automation_provider_list.cc
@@ -37,6 +37,8 @@ bool AutomationProviderList::RemoveProvider(AutomationProvider* provider) {
(*remove_provider)->Release();
automation_providers_.erase(remove_provider);
g_browser_process->ReleaseModule();
+ if (automation_providers_.empty())
+ OnLastProviderRemoved();
return true;
}
return false;
diff --git a/chrome/browser/automation/automation_provider_list.h b/chrome/browser/automation/automation_provider_list.h
index 5e22d37..bedb6a6 100644
--- a/chrome/browser/automation/automation_provider_list.h
+++ b/chrome/browser/automation/automation_provider_list.h
@@ -37,6 +37,7 @@ class AutomationProviderList {
private:
AutomationProviderList();
+ void OnLastProviderRemoved();
list_type automation_providers_;
static AutomationProviderList* instance_;
diff --git a/chrome/browser/automation/automation_provider_list_generic.cc b/chrome/browser/automation/automation_provider_list_generic.cc
new file mode 100644
index 0000000..868d509
--- /dev/null
+++ b/chrome/browser/automation/automation_provider_list_generic.cc
@@ -0,0 +1,8 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/automation/automation_provider_list.h"
+
+void AutomationProviderList::OnLastProviderRemoved() {
+}
diff --git a/chrome/browser/automation/automation_provider_list_mac.mm b/chrome/browser/automation/automation_provider_list_mac.mm
new file mode 100644
index 0000000..4d408fd
--- /dev/null
+++ b/chrome/browser/automation/automation_provider_list_mac.mm
@@ -0,0 +1,13 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/automation/automation_provider_list.h"
+
+#import "chrome/browser/app_controller_mac.h"
+
+void AutomationProviderList::OnLastProviderRemoved() {
+ // We need to explicitly quit the application here because on Mac
+ // the controller holds an additional reference to g_browser_process.
+ [[NSApp delegate] quit:nil];
+}
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons
index 273355e..222f1e6 100644
--- a/chrome/browser/browser.scons
+++ b/chrome/browser/browser.scons
@@ -218,6 +218,8 @@ input_files = ChromeFileList([
'automation/automation_provider.cc',
'automation/automation_provider.h',
'automation/automation_provider_list.cc',
+ 'automation/automation_provider_list_generic.cc',
+ 'automation/automation_provider_list_mac.mm',
'automation/automation_provider_list.h',
'automation/automation_resource_tracker.cc',
'automation/automation_resource_tracker.h',
@@ -778,6 +780,12 @@ if env.Bit('mac'):
'tab_contents/web_contents_view.cc',
)
+if not env.Bit('mac'):
+ # Mac-specific files
+ input_files.Remove(
+ 'automation/automation_provider_list_mac.mm',
+ )
+
if env.Bit('windows'):
env.TypeLibrary('history/history_indexer.idl')
diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj
index 2e84c1f..2d792bf 100644
--- a/chrome/browser/browser.vcproj
+++ b/chrome/browser/browser.vcproj
@@ -830,6 +830,10 @@
>
</File>
<File
+ RelativePath=".\automation\automation_provider_list_generic.cc"
+ >
+ </File>
+ <File
RelativePath=".\automation\automation_provider_list.h"
>
</File>
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 05e1e5a..3afef30 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -393,6 +393,8 @@
'browser/automation/automation_provider.cc',
'browser/automation/automation_provider.h',
'browser/automation/automation_provider_list.cc',
+ 'browser/automation/automation_provider_list_generic.cc',
+ 'browser/automation/automation_provider_list_mac.mm',
'browser/automation/automation_provider_list.h',
'browser/automation/automation_resource_tracker.cc',
'browser/automation/automation_resource_tracker.h',
@@ -1218,6 +1220,7 @@
'sources!': [
'browser/autocomplete/autocomplete_edit.cc',
'browser/autocomplete/autocomplete_popup_model.cc',
+ 'browser/automation/automation_provider_list_generic.cc',
'browser/bookmarks/bookmark_context_menu.cc',
'browser/bookmarks/bookmark_drop_info.cc',
'browser/debugger/debugger_shell_stubs.cc',
@@ -1259,13 +1262,6 @@
],
}, { # 'OS!="win"
'sources/': [
- # Exclude most of automation.
- ['exclude', '^browser/automation/'],
- ['include', '^browser/automation/automation_provider\\.cc$'],
- ['include', '^browser/automation/automation_provider_list\\.cc$'],
- ['include', '^browser/automation/automation_resource_tracker\\.cc$'],
- ['include', '^browser/automation/url_request_[^/]*_job\\.cc$'],
-
# Exclude all of hang_monitor.
['exclude', '^browser/hang_monitor/'],
@@ -1286,6 +1282,7 @@
'sources!': [
'browser/app_modal_dialog_queue.cc',
'browser/autocomplete/autocomplete_accessibility.cc',
+ 'browser/automation/ui_controls.cc',
'browser/browser_accessibility.cc',
'browser/browser_accessibility_manager.cc',
'browser/debugger/debugger_view.cc',
@@ -1694,16 +1691,6 @@
'test/testing_profile.h',
],
'conditions': [
- ['OS=="mac"', {
- 'sources!': [
- 'test/automation/automation_proxy.cc',
- 'test/automation/automation_proxy.h',
- 'test/automation/browser_proxy.cc',
- 'test/automation/browser_proxy.h',
- 'test/automation/tab_proxy.cc',
- 'test/automation/tab_proxy.h',
- ],
- }],
['OS=="win"', {
'include_dirs': [
'third_party/wtl/include',
@@ -2164,6 +2151,35 @@
}],
],
},
+ {
+ 'target_name': 'startup_tests',
+ 'type': 'executable',
+ 'dependencies': [
+ 'app',
+ 'browser',
+ 'common',
+ 'resources',
+ 'test_support_ui',
+ '../base/base.gyp:base',
+ '../skia/skia.gyp:skia',
+ '../testing/gtest.gyp:gtest',
+ ],
+ 'sources': [
+ 'test/startup/feature_startup_test.cc',
+ 'test/startup/startup_test.cc',
+ 'tools/build/win/precompiled.cc',
+ 'tools/build/win/precompiled.h',
+ ],
+ 'conditions': [
+ ['OS!="win"', {
+ 'sources!': [
+ 'test/startup/feature_startup_test.cc',
+ 'tools/build/win/precompiled.cc',
+ 'tools/build/win/precompiled.h',
+ ],
+ }],
+ ],
+ },
],
'conditions': [
['OS=="mac"',
@@ -2241,34 +2257,6 @@
}],
],
},
- {
- 'target_name': 'startup_tests',
- 'type': 'executable',
- 'dependencies': [
- 'browser',
- 'common',
- 'resources',
- 'test_support_ui',
- '../base/base.gyp:base',
- '../skia/skia.gyp:skia',
- '../testing/gtest.gyp:gtest',
- ],
- 'sources': [
- 'test/startup/feature_startup_test.cc',
- 'test/startup/startup_test.cc',
- 'tools/build/win/precompiled.cc',
- 'tools/build/win/precompiled.h',
- ],
- 'conditions': [
- ['OS!="win"', {
- 'sources!': [
- 'test/startup/feature_startup_test.cc',
- 'tools/build/win/precompiled.cc',
- 'tools/build/win/precompiled.h',
- ],
- }],
- ],
- },
],
}], # OS!="mac"
['OS=="win"',
diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc
index 9c248cd..e0d53be 100644
--- a/chrome/common/chrome_constants.cc
+++ b/chrome/common/chrome_constants.cc
@@ -16,7 +16,16 @@ namespace chrome {
const wchar_t kBrowserProcessExecutableName[] = L"chrome.exe";
#elif defined(OS_LINUX)
const wchar_t kBrowserProcessExecutableName[] = L"chrome";
+#elif defined(OS_MACOSX)
+const wchar_t kBrowserProcessExecutableName[] =
+// TODO(thomasvl): Un-hardcode path inside the bundle in case we want to use
+// this constant for something other than test code.
+#if defined(GOOGLE_CHROME_BUILD)
+ L"Chrome.app/Contents/MacOS/Chrome";
+#else
+ L"Chromium.app/Contents/MacOS/Chromium";
#endif
+#endif // defined(MACOSX)
#if defined(GOOGLE_CHROME_BUILD)
const wchar_t kBrowserAppName[] = L"Chrome";
const char kStatsFilename[] = "ChromeStats2";
diff --git a/chrome/test/startup/startup_test.cc b/chrome/test/startup/startup_test.cc
index 72b239b..c63629a 100644
--- a/chrome/test/startup/startup_test.cc
+++ b/chrome/test/startup/startup_test.cc
@@ -107,8 +107,6 @@ class StartupFileTest : public StartupTest {
}
};
-} // namespace
-
TEST_F(StartupTest, Perf) {
RunStartupTest("warm", "t", false /* not cold */, true /* important */);
}
@@ -138,3 +136,5 @@ TEST_F(StartupFileTest, PerfColdGears) {
}
#endif // defined(OS_WIN)
+
+} // namespace