[CherryPick] input element with placeholder text and width set to 100% on focus cause...
[framework/web/webkit-efl.git] / Tools / BuildSlaveSupport / kill-old-processes
1 #!/usr/bin/python\r
2 # Copyright (C) 2010 Apple Inc.  All rights reserved.\r
3 # Copyright (C) 2011 Google Inc.  All rights reserved.\r
4 #\r
5 # Redistribution and use in source and binary forms, with or without\r
6 # modification, are permitted provided that the following conditions\r
7 # are met:\r
8 #\r
9 # 1.  Redistributions of source code must retain the above copyright\r
10 #     notice, this list of conditions and the following disclaimer.\r
11 # 2.  Redistributions in binary form must reproduce the above copyright\r
12 #     notice, this list of conditions and the following disclaimer in the\r
13 #     documentation and/or other materials provided with the distribution.\r
14 #\r
15 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY\r
16 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
17 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
18 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\r
19 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
20 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
21 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
22 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
23 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
24 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
25 \r
26 import os, sys\r
27 \r
28 \r
29 def main():\r
30     tasksToKillWin = [\r
31         "cl.exe",\r
32         "devenv.com",\r
33         "devenv.exe",\r
34         "DumpRenderTree.exe",\r
35         "DumpRenderTree_debug.exe",\r
36         "httpd.exe",\r
37         "imagediff.exe",\r
38         "imagediff_debug.exe",\r
39         "jsc.exe",\r
40         "jsc_debug.exe",\r
41         "LightTPD.exe",\r
42         "link.exe",\r
43         "midl.exe",\r
44         "perl.exe",\r
45         "Safari.exe",\r
46         "svn.exe",\r
47         "testapi.exe",\r
48         "testapi_debug.exe",\r
49         "VcBuildHelper.exe",\r
50         "wdiff.exe",\r
51         "WebKit2WebProcess.exe",\r
52         "WebKit2WebProcess_debug.exe",\r
53         "WebKitTestRunner.exe",\r
54         "WebKitTestRunner_debug.exe",\r
55     ]\r
56 \r
57     tasksToKillMac = [\r
58         "apache2",\r
59         "cc1plus",\r
60         "cc1objplus",\r
61         "clang",\r
62         "clang++",\r
63         "gcc-4.2",\r
64         "httpd",\r
65         "i686-apple-darwin10-gcc-4.2.1",\r
66         "jsc",\r
67         "make",\r
68         "pboard", # FIXME: https://bugs.webkit.org/show_bug.cgi?id=81012\r
69         "per5.12",\r
70         "perl",\r
71         "Problem Reporter",\r
72         "ruby",\r
73         "Safari Web Content",\r
74         "Safari",\r
75         "svn",\r
76         "DumpRenderTree",\r
77         "TestWebKitAPI Web Content",\r
78         "TestWebKitAPI",\r
79         "WebKitPluginAgen", # FIXME: Why no 't'?\r
80         "WebKitTestRunner Web Content",\r
81         "WebKitTestRunner",\r
82         "WebProcess",\r
83         "xcodebuild",\r
84     ]\r
85 \r
86     taskToKillUnix = [\r
87         "apache2",\r
88         "cc1plus",\r
89         "DumpRenderTree",\r
90         "gold",\r
91         "httpd",\r
92         "ld",\r
93         "make",\r
94         "ruby",\r
95         "svn",\r
96         "webkit_unit_tests",\r
97         "WebKitTestRunner",\r
98     ]\r
99 \r
100     if sys.platform == 'darwin':\r
101         for task in tasksToKillMac:\r
102             os.system("killall -9 -v -m " + task)\r
103         # Kill all instances of python executing run-webkit-tests\r
104         os.system("ps aux | grep -P '.+/Python .+(run_webkit_tests|run-webkit-tests)' | grep -v grep | awk '{print $2}' | xargs kill")\r
105     elif sys.platform == 'cygwin' or sys.platform == 'win32':\r
106         for task in tasksToKillWin:\r
107             os.system("taskkill /t /f /im " + task)\r
108     elif sys.platform.startswith('linux'):\r
109         for task in taskToKillUnix:\r
110             os.system("killall -9 -v " + task)\r
111         os.system("ps aux | grep -P '.+/python .+(run_webkit_tests|run-webkit-tests)' | grep -v grep | awk '{print $2}' | xargs kill")\r
112     else:\r
113         sys.exit()\r
114         # FIXME: Should we return an exit code based on how the kills went?\r
115 \r
116 \r
117 if __name__ == '__main__':\r
118     sys.exit(main())\r