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

Side by Side Diff: frontend/client/src/autotest/tko/TkoUtils.java

Issue 1595019: Merge remote branch 'origin/upstream' into tempbranch (Closed)
Patch Set: Created 10 years, 8 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 package autotest.tko; 1 package autotest.tko;
2 2
3 import autotest.common.JSONArrayList; 3 import autotest.common.JSONArrayList;
4 import autotest.common.JsonRpcProxy; 4 import autotest.common.JsonRpcProxy;
5 import autotest.common.StaticDataRepository; 5 import autotest.common.StaticDataRepository;
6 import autotest.common.Utils; 6 import autotest.common.Utils;
7 import autotest.common.table.RpcDataSource; 7 import autotest.common.table.RpcDataSource;
8 import autotest.common.table.DataSource.Query; 8 import autotest.common.table.DataSource.Query;
9 9
10 import com.google.gwt.dom.client.Element;
11 import com.google.gwt.http.client.URL; 10 import com.google.gwt.http.client.URL;
12 import com.google.gwt.json.client.JSONArray; 11 import com.google.gwt.json.client.JSONArray;
13 import com.google.gwt.json.client.JSONObject; 12 import com.google.gwt.json.client.JSONObject;
14 import com.google.gwt.json.client.JSONString; 13 import com.google.gwt.json.client.JSONString;
15 import com.google.gwt.json.client.JSONValue; 14 import com.google.gwt.json.client.JSONValue;
16 import com.google.gwt.user.client.DOM; 15 import com.google.gwt.user.client.DOM;
17 import com.google.gwt.user.client.ui.FlexTable; 16 import com.google.gwt.user.client.ui.FlexTable;
18 import com.google.gwt.user.client.ui.Widget; 17 import com.google.gwt.user.client.ui.Widget;
19 18
20 import java.util.ArrayList; 19 import java.util.ArrayList;
(...skipping 24 matching lines...) Expand all
45 } 44 }
46 return fields; 45 return fields;
47 } 46 }
48 47
49 protected static JSONObject getConditionParams(String condition) { 48 protected static JSONObject getConditionParams(String condition) {
50 JSONObject params = new JSONObject(); 49 JSONObject params = new JSONObject();
51 params.put("extra_where", new JSONString(condition)); 50 params.put("extra_where", new JSONString(condition));
52 return params; 51 return params;
53 } 52 }
54 53
55 protected static void clearDomChildren(Element elem) {
56 Element child = elem.getFirstChildElement();
57 while (child != null) {
58 Element nextChild = child.getNextSiblingElement();
59 elem.removeChild(child);
60 child = nextChild;
61 }
62 }
63
64 static void setElementVisible(String elementId, boolean visible) { 54 static void setElementVisible(String elementId, boolean visible) {
65 DOM.getElementById(elementId).getStyle().setProperty("display", visible ? "" : "none"); 55 DOM.getElementById(elementId).getStyle().setProperty("display", visible ? "" : "none");
66 } 56 }
67 57
68 static String getSqlCondition(JSONObject args) { 58 static String getSqlCondition(JSONObject args) {
69 final JSONValue condition = args.get("extra_where"); 59 final JSONValue condition = args.get("extra_where");
70 if (condition == null) { 60 if (condition == null) {
71 return ""; 61 return "";
72 } 62 }
73 return condition.isString().stringValue(); 63 return condition.isString().stringValue();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 97
108 JSONObject request = JsonRpcProxy.buildRequestObject(rpcMethodName, argu ments); 98 JSONObject request = JsonRpcProxy.buildRequestObject(rpcMethodName, argu ments);
109 if (extraParams != null) { 99 if (extraParams != null) {
110 Utils.updateObject(request, extraParams); 100 Utils.updateObject(request, extraParams);
111 } 101 }
112 102
113 String url = JsonRpcProxy.TKO_BASE_URL + "csv/?" + URL.encode(request.to String()); 103 String url = JsonRpcProxy.TKO_BASE_URL + "csv/?" + URL.encode(request.to String());
114 Utils.openUrlInNewWindow(url); 104 Utils.openUrlInNewWindow(url);
115 } 105 }
116 } 106 }
OLDNEW
« no previous file with comments | « frontend/client/src/autotest/tko/TableRenderer.java ('k') | frontend/migrations/055_ensure_invalidated_test_label_exists.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698