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

Side by Side Diff: chrome/test/nacl/nacl_browsertest.cc

Issue 14238013: Set up NaClChromeMainArgs number_of_cores member so apps can size threadpools appropriately (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed name of helper Created 7 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stdio.h>
6 #if defined(OS_POSIX)
7 #include <unistd.h>
8 #elif defined(OS_WIN)
9 #include <windows.h>
10 #endif
11
5 #include "chrome/test/nacl/nacl_browsertest_util.h" 12 #include "chrome/test/nacl/nacl_browsertest_util.h"
6 13
7 namespace { 14 namespace {
8 15
9 // These tests fail on Linux ASAN bots: <http://crbug.com/161709>. 16 // These tests fail on Linux ASAN bots: <http://crbug.com/161709>.
10 #if defined(OS_LINUX) && defined(ADDRESS_SANITIZER) 17 #if defined(OS_LINUX) && defined(ADDRESS_SANITIZER)
11 #define MAYBE_SimpleLoad DISABLED_SimpleLoad 18 #define MAYBE_SimpleLoad DISABLED_SimpleLoad
12 #define MAYBE_ExitStatus0 DISABLED_ExitStatus0 19 #define MAYBE_ExitStatus0 DISABLED_ExitStatus0
13 #define MAYBE_ExitStatus254 DISABLED_ExitStatus254 20 #define MAYBE_ExitStatus254 DISABLED_ExitStatus254
14 #define MAYBE_ExitStatusNeg2 DISABLED_ExitStatusNeg2 21 #define MAYBE_ExitStatusNeg2 DISABLED_ExitStatusNeg2
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 }) 58 })
52 59
53 NACL_BROWSER_TEST_F(NaClBrowserTest, MAYBE_PPAPICore, { 60 NACL_BROWSER_TEST_F(NaClBrowserTest, MAYBE_PPAPICore, {
54 RunNaClIntegrationTest(FILE_PATH_LITERAL("ppapi_ppb_core.html")); 61 RunNaClIntegrationTest(FILE_PATH_LITERAL("ppapi_ppb_core.html"));
55 }) 62 })
56 63
57 NACL_BROWSER_TEST_F(NaClBrowserTest, MAYBE_ProgressEvents, { 64 NACL_BROWSER_TEST_F(NaClBrowserTest, MAYBE_ProgressEvents, {
58 RunNaClIntegrationTest(FILE_PATH_LITERAL("ppapi_progress_events.html")); 65 RunNaClIntegrationTest(FILE_PATH_LITERAL("ppapi_progress_events.html"));
59 }) 66 })
60 67
68 // Visual Studio does not like preprocessor conditionals inside the
69 // argument of a macro, so we put the conditionals on a helper
70 // function. We are already in an anonymous namespace, so the name of
71 // the helper is not visible in external scope.
72 //
73 // The string buffer is sufficient sized: 2**64 < 8**22 < 10**22.
74 #if defined(OS_POSIX)
75 base::FilePath::StringType NumberOfCoresAsFilePathString() {
76 char string_rep[23];
77 snprintf(string_rep, sizeof string_rep, "%ld", sysconf(_SC_NPROCESSORS_ONLN));
78 return string_rep;
79 }
80 #elif defined(OS_WIN)
81 base::FilePath::StringType NumberOfCoresAsFilePathString() {
82 wchar_t string_rep[23];
83 SYSTEM_INFO system_info;
84 GetSystemInfo(&system_info);
85 _snwprintf_s(string_rep, sizeof string_rep, _TRUNCATE, L"%u",
86 system_info.dwNumberOfProcessors);
87 return string_rep;
88 }
89 #endif
90
91 NACL_BROWSER_TEST_F(NaClBrowserTest, SysconfNprocessorsOnln, {
jvoung (off chromium) 2013/04/17 17:07:18 You might not need to "MAYBE_${testname}", but I c
bsy 2013/04/17 20:55:21 Done.
92 base::FilePath::StringType path =
93 FILE_PATH_LITERAL("sysconf_nprocessors_onln_test.html?cpu_count=");
94 path = path + NumberOfCoresAsFilePathString();
95 RunNaClIntegrationTest(path);
96 })
97
61 IN_PROC_BROWSER_TEST_F(NaClBrowserTestStatic, MAYBE_CrossOriginCORS) { 98 IN_PROC_BROWSER_TEST_F(NaClBrowserTestStatic, MAYBE_CrossOriginCORS) {
62 RunLoadTest(FILE_PATH_LITERAL("cross_origin/cors.html")); 99 RunLoadTest(FILE_PATH_LITERAL("cross_origin/cors.html"));
63 } 100 }
64 101
65 IN_PROC_BROWSER_TEST_F(NaClBrowserTestStatic, MAYBE_CrossOriginFail) { 102 IN_PROC_BROWSER_TEST_F(NaClBrowserTestStatic, MAYBE_CrossOriginFail) {
66 RunLoadTest(FILE_PATH_LITERAL("cross_origin/fail.html")); 103 RunLoadTest(FILE_PATH_LITERAL("cross_origin/fail.html"));
67 } 104 }
68 105
69 IN_PROC_BROWSER_TEST_F(NaClBrowserTestStatic, MAYBE_SameOriginCookie) { 106 IN_PROC_BROWSER_TEST_F(NaClBrowserTestStatic, MAYBE_SameOriginCookie) {
70 RunLoadTest(FILE_PATH_LITERAL("cross_origin/same_origin_cookie.html")); 107 RunLoadTest(FILE_PATH_LITERAL("cross_origin/same_origin_cookie.html"));
(...skipping 17 matching lines...) Expand all
88 MAYBE_PNACL(PnaclNMFOptionsOlarge)) { 125 MAYBE_PNACL(PnaclNMFOptionsOlarge)) {
89 RunLoadTest(FILE_PATH_LITERAL("pnacl_options.html?use_nmf=o_large")); 126 RunLoadTest(FILE_PATH_LITERAL("pnacl_options.html?use_nmf=o_large"));
90 } 127 }
91 128
92 IN_PROC_BROWSER_TEST_F(NaClBrowserTestPnacl, 129 IN_PROC_BROWSER_TEST_F(NaClBrowserTestPnacl,
93 MAYBE_PNACL(PnaclNMFOptionsTimePasses)) { 130 MAYBE_PNACL(PnaclNMFOptionsTimePasses)) {
94 RunLoadTest(FILE_PATH_LITERAL("pnacl_options.html?use_nmf=time_passes")); 131 RunLoadTest(FILE_PATH_LITERAL("pnacl_options.html?use_nmf=time_passes"));
95 } 132 }
96 133
97 } // namespace anonymous 134 } // namespace anonymous
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698