Bug 1477599 - Move StyloParsingBench helper functions into #if as well. r=emilio
authorXidorn Quan <me@upsuper.org>
Mon, 23 Jul 2018 09:51:41 +1000
changeset 427721 34a99ee4f1c0374fc720231bde921c25ed13700c
parent 427720 795f30107e2a31c04163a53397c4ed693b235e25
child 427722 945a4aa49045c2ceb062bce93da733d11ecde0bd
push id66694
push userxquan@mozilla.com
push dateMon, 23 Jul 2018 00:18:49 +0000
treeherderautoland@34a99ee4f1c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1477599
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1477599 - Move StyloParsingBench helper functions into #if as well. r=emilio MozReview-Commit-ID: GhcdIdX6IBk
layout/style/test/gtest/StyloParsingBench.cpp
--- a/layout/style/test/gtest/StyloParsingBench.cpp
+++ b/layout/style/test/gtest/StyloParsingBench.cpp
@@ -12,21 +12,23 @@
 #include "mozilla/Encoding.h"
 #include "mozilla/NullPrincipalURI.h"
 
 using namespace mozilla;
 using namespace mozilla::css;
 using namespace mozilla::dom;
 using namespace mozilla::net;
 
+// Bug 1436018 - Disable Stylo microbenchmark on Windows
+#if !defined(_WIN32) && !defined(_WIN64)
+
 #define PARSING_REPETITIONS 20
 #define SETPROPERTY_REPETITIONS (1000 * 1000)
 #define GETPROPERTY_REPETITIONS (1000 * 1000)
 
-
 static void ServoParsingBench() {
 
   auto css = AsBytes(MakeStringSpan(EXAMPLE_STYLESHEET));
   nsCString cssStr;
   cssStr.Append(css);
   ASSERT_EQ(Encoding::UTF8ValidUpTo(css), css.Length());
 
   RefPtr<URLExtraData> data = new URLExtraData(
@@ -93,22 +95,21 @@ static void ServoGetPropertyValueById() 
       block,
       eCSSProperty_width,
       &value
     );
     ASSERT_TRUE(value.EqualsLiteral("10px"));
   }
 }
 
-// Bug 1436018 - Disable Stylo microbenchmark on Windows
-#if !defined(_WIN32) && !defined(_WIN64)
 MOZ_GTEST_BENCH(Stylo, Servo_StyleSheet_FromUTF8Bytes_Bench, ServoParsingBench);
 
 MOZ_GTEST_BENCH(Stylo, Servo_DeclarationBlock_SetPropertyById_Bench, [] {
   ServoSetPropertyByIdBench(NS_LITERAL_CSTRING("10px"));
 });
 
 MOZ_GTEST_BENCH(Stylo, Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench, [] {
   ServoSetPropertyByIdBench(NS_LITERAL_CSTRING(" 10px"));
 });
 
 MOZ_GTEST_BENCH(Stylo, Servo_DeclarationBlock_GetPropertyById_Bench, ServoGetPropertyValueById);
+
 #endif